View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Shane Devenshire[_2_] Shane Devenshire[_2_] is offline
external usenet poster
 
Posts: 3,346
Default how do I get a result if one cell is X and the 2nd cell is Y where

Hi,

You need to correct the logical problems in your stated question. For this
answer I have made some assumptions, which you can adjust:

=IF(OR(AND(A2<=4/24,B2=1),AND(A2<=9/24,B2=2),AND(A2<=27/24,B2=3)),"met
target",IF(OR(AND(A2<6/24,B2=1),AND(A29/24,A2<13.5/24,B2=2),AND(A227/24,A2<45/24,B2=3)),"warning",IF(B2=4,NA(),"alert")))

Note that your next to last condition reads

if b2 = 2 and a2 is greater than 45 return alert
but it looks like it should be
if b2 = 3 and a2 is greater than 45 return alert

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"catts22" wrote:

A2 = hours [hh]:mm:ss (this is the result of another formula)
B2 = the number 1, 2, 3, or 4

What I need is:

If b2 = 1 and a2 is less than or equal to 4 (hours) return met target
If b2 = 1 and a2 is greater than 4, but less than 6 return warning
if b2 = 1 and a2 is greater than 6 return alert
if b2 = 2 and a2 is less than or equal to 9 return met target
if b2 = 2 and a2 is greater than 9 but less than 13.5 return warning
if b2 = 2 and a2 is greater than 13.5 return alert
if b2 = 3 and a2 is less than or equal to 27 return met target
if b2 = 3 and a2 is greater than 27 but less than 45 return warning
if b2 = 2 and a2 is greater than 45 return alert
if b2 = 4 return n/a

I have tried a bunch of different things (if/and/or/lookups) and nothing
works. Please help... trying to meet a deadline.

Thanks