A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

return different values based on 4 criteria?



 
 
Thread Tools Display Modes
  #1  
Old March 16th, 2010, 04:53 PM posted to microsoft.public.excel.worksheet.functions
Susie (SFAngelgirl)[_2_]
external usenet poster
 
Posts: 6
Default return different values based on 4 criteria?

Need Formula or macro to allocate the "Scheduled hours" based on Group Counts:

If Group "A" and "C" are both greater than 1, then Scheduled "A" and "C"
should both be 6 hours
If Group "A" and "C" are equal to or less than 0, then Scheduled "A" and "C"
should both be 0 hours
If Group "A" greater than 1, and Group "C" is equal to 0, then Scheduled "A"
should 12 hours
If Group "C" greater than 1, and Group "A" is equal to 0, then Scheduled "C"
should 12 hours

What should be returned for Scheduled Hours
Group Count Scheduled Hours
A B A B
1047 1192 6 6
0 995 0 12
1752 0 12 0
0 0 0 0
0 0 0 0

  #2  
Old March 16th, 2010, 06:09 PM posted to microsoft.public.excel.worksheet.functions
Gary Brown[_5_]
external usenet poster
 
Posts: 87
Default return different values based on 4 criteria?

- Assume Group A is in column A
- Assume Group C is in column B
- Assume data begins in row 2

- Scheduled Hours for Group A would be...
=IF(AND(A20,B20),6,IF(AND(A2=0,B2=0),0,IF(AND( A20,B2=0),12,0)))

-Scheduled Hours for Group C would be...
=IF(AND(A20,B20),6,IF(AND(A2=0,B2=0),0,IF(AND( A2=0,B20),12,0)))


--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Susie (SFAngelgirl)" wrote:

Need Formula or macro to allocate the "Scheduled hours" based on Group Counts:

If Group "A" and "C" are both greater than 1, then Scheduled "A" and "C"
should both be 6 hours
If Group "A" and "C" are equal to or less than 0, then Scheduled "A" and "C"
should both be 0 hours
If Group "A" greater than 1, and Group "C" is equal to 0, then Scheduled "A"
should 12 hours
If Group "C" greater than 1, and Group "A" is equal to 0, then Scheduled "C"
should 12 hours

What should be returned for Scheduled Hours
Group Count Scheduled Hours
A B A B
1047 1192 6 6
0 995 0 12
1752 0 12 0
0 0 0 0
0 0 0 0

  #3  
Old March 16th, 2010, 07:45 PM posted to microsoft.public.excel.worksheet.functions
Teethless mama
external usenet poster
 
Posts: 3,722
Default return different values based on 4 criteria?

Scheduled Hours for Group A
=MAX((A21)*12-(B21)*6,0)


Scheduled Hours for Group C
=MAX((B21)*12-(A21)*6,0)



"Susie (SFAngelgirl)" wrote:

Need Formula or macro to allocate the "Scheduled hours" based on Group Counts:

If Group "A" and "C" are both greater than 1, then Scheduled "A" and "C"
should both be 6 hours
If Group "A" and "C" are equal to or less than 0, then Scheduled "A" and "C"
should both be 0 hours
If Group "A" greater than 1, and Group "C" is equal to 0, then Scheduled "A"
should 12 hours
If Group "C" greater than 1, and Group "A" is equal to 0, then Scheduled "C"
should 12 hours

What should be returned for Scheduled Hours
Group Count Scheduled Hours
A B A B
1047 1192 6 6
0 995 0 12
1752 0 12 0
0 0 0 0
0 0 0 0

  #4  
Old March 16th, 2010, 09:31 PM posted to microsoft.public.excel.worksheet.functions
Susan in Sacramento
external usenet poster
 
Posts: 4
Default return different values based on 4 criteria?

Worked on the first try - thank you - It saved me hours of work
--
Thanks - Suze


"Teethless mama" wrote:

Scheduled Hours for Group A
=MAX((A21)*12-(B21)*6,0)


Scheduled Hours for Group C
=MAX((B21)*12-(A21)*6,0)



"Susie (SFAngelgirl)" wrote:

Need Formula or macro to allocate the "Scheduled hours" based on Group Counts:

If Group "A" and "C" are both greater than 1, then Scheduled "A" and "C"
should both be 6 hours
If Group "A" and "C" are equal to or less than 0, then Scheduled "A" and "C"
should both be 0 hours
If Group "A" greater than 1, and Group "C" is equal to 0, then Scheduled "A"
should 12 hours
If Group "C" greater than 1, and Group "A" is equal to 0, then Scheduled "C"
should 12 hours

What should be returned for Scheduled Hours
Group Count Scheduled Hours
A B A B
1047 1192 6 6
0 995 0 12
1752 0 12 0
0 0 0 0
0 0 0 0

  #5  
Old March 16th, 2010, 09:31 PM posted to microsoft.public.excel.worksheet.functions
Susan in Sacramento
external usenet poster
 
Posts: 4
Default return different values based on 4 criteria?

Teethless Mama provided a MAX function that worked great! I couldn't get
your answer to work just right - but it helped me with anohter nested IF AND
issue. THank you Gary
--
Thanks - Suze


"Gary Brown" wrote:

- Assume Group A is in column A
- Assume Group C is in column B
- Assume data begins in row 2

- Scheduled Hours for Group A would be...
=IF(AND(A20,B20),6,IF(AND(A2=0,B2=0),0,IF(AND( A20,B2=0),12,0)))

-Scheduled Hours for Group C would be...
=IF(AND(A20,B20),6,IF(AND(A2=0,B2=0),0,IF(AND( A2=0,B20),12,0)))


--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Susie (SFAngelgirl)" wrote:

Need Formula or macro to allocate the "Scheduled hours" based on Group Counts:

If Group "A" and "C" are both greater than 1, then Scheduled "A" and "C"
should both be 6 hours
If Group "A" and "C" are equal to or less than 0, then Scheduled "A" and "C"
should both be 0 hours
If Group "A" greater than 1, and Group "C" is equal to 0, then Scheduled "A"
should 12 hours
If Group "C" greater than 1, and Group "A" is equal to 0, then Scheduled "C"
should 12 hours

What should be returned for Scheduled Hours
Group Count Scheduled Hours
A B A B
1047 1192 6 6
0 995 0 12
1752 0 12 0
0 0 0 0
0 0 0 0

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.