# Yellow RAG Formula: Between 2 Numbers (Greater Than Less Than)

Options
✭✭✭✭

Greetings Smartsheet Community:

I Need to Add a Range in my Formula Between -9 & -1 to Turn Yellow. Thanks

Current Formula:

=IF(OR([Schedule Variance]@row > 0, [Schedule Variance]@row = 0), "Green", IF([Schedule Variance]@row <= -10, "Red"))

• ✭✭✭✭✭✭
Options

Try this. I would usually put the checks for ISBLANK first in the nested IF, then check the conditions for the Schedule Variance. The logic in IF statements can be a little weird and take some practice. I'd suggest reading up on the IF function in their online help.

You have to be careful with placement of the parenthesis for both the IF statement and any other functions like ISBLANK that you're using.

=IF(ISBLANK([Schedule Variance]@row), "Gray", IF([Schedule Variance]@row >= 0, "Green", IF([Schedule Variance]@row <= -10, "Red", "Yellow")))

• ✭✭✭✭
Options

Excellent, That Worked! Thanks

• ✭✭✭✭✭✭
Options

=IF([Schedule Variance]@row >= 0, "Green", IF([Schedule Variance]@row <= -10, "Red", “Yellow”))

• ✭✭✭✭
Options

That Worked, but I forgot to Add If Schedule Variance is Blank / Empty, then the Result Should be Gray.

My Attempt but Unsuccessful:

=IF([Schedule Variance]@row >= 0, "Green", IF([Schedule Variance]@row <= -10, "Red", "Yellow", IF(ISBLANK([Schedule Variance]@row, "Gray"))))

• ✭✭✭✭✭✭
Options

Try this. I would usually put the checks for ISBLANK first in the nested IF, then check the conditions for the Schedule Variance. The logic in IF statements can be a little weird and take some practice. I'd suggest reading up on the IF function in their online help.

You have to be careful with placement of the parenthesis for both the IF statement and any other functions like ISBLANK that you're using.

=IF(ISBLANK([Schedule Variance]@row), "Gray", IF([Schedule Variance]@row >= 0, "Green", IF([Schedule Variance]@row <= -10, "Red", "Yellow")))

• ✭✭✭✭