Nesting IF Statements Based on Same Cell Value

C

Cheryl B.

Working on a 'dashboard' ... more like a traffic light, though, I think.

Based on the same cell value {F21) , these statements work fine when written
separately:
=IF(F21<0.02,"G",0)
=IF(AND(F21>0.02,F21<0.06),"Y",0)
=IF(F21>=0.06,"R",0)

How can I 'hook' them together as one string with one result?
 
B

Bob Umlas

=IF(F21<.02,"G",IF(F21<.06,"Y","R"))
assuming you really meant your 2nd equation to be ...F21>=.02, not just >.

Bob Umlas
Excel MVP
 
H

Harlan Grove

Bob Umlas wrote...
=IF(F21<.02,"G",IF(F21<.06,"Y","R"))
assuming you really meant your 2nd equation to be ...F21>=.02, not just >.
....

Or make it a lookup.

=LOOKUP(F21,{-1E307;0.02;0.06},{"G";"Y";"R"})
 
B

Barb R.

You may even want to use a conditional format for this. Access conditional
formatting for a cell by selecting the cell and selecting FORMAT ->
CONDITIONAL FORMATTING.
 
C

Cheryl B.

EXcellent ...Thanks, Bob!

Bob Umlas said:
=IF(F21<.02,"G",IF(F21<.06,"Y","R"))
assuming you really meant your 2nd equation to be ...F21>=.02, not just >.

Bob Umlas
Excel MVP
 
Top