Help on IF condition

K

Karthik

I want cell 'G4' to show "Red" if the value Cell 'D4' is greater than the
value of 'A7' and 'E4' is greater than 'A9' and show "Green" if any one of
them is less than 'A7' or 'A9' respectively.
I tried a formula but it didn't work as I expected.
=IF(AND(D4>$A$7,E4>$A$9),"Red","Green")
Any suggestions would be appreciated.

Thanks..
 
J

Jacob Skaria

=IF(AND(D4>$A$7,E4>$A$9),"Red","Green")
will display Green for all conditions unless d4 and E4 are greater than...
If blank or equal, then you need to deal with that as well..

=IF(AND(D4>$A$7,E4>$A$9),"Red",IF(OR(D4<$A$7,E4<$A$9),"Green",""))
 
K

Karthik

Thanks Jacob,
--
Karthi


Jacob Skaria said:
=IF(AND(D4>$A$7,E4>$A$9),"Red","Green")
will display Green for all conditions unless d4 and E4 are greater than...
If blank or equal, then you need to deal with that as well..

=IF(AND(D4>$A$7,E4>$A$9),"Red",IF(OR(D4<$A$7,E4<$A$9),"Green",""))
 
Top