# How to write a RYG formula for a range of values?

✭✭✭✭✭✭

I am working on a formula for:

1) If cell is empty = Yellow

2) If cell is between -20 to 20 = Green

3) Otherwise = Red

How should I write this formula?

I am able to get the formula right if it is simpler as follows:

1) If cell is empty = Yellow

2) If cell is 0 = Green

3) Otherwise = Red

=IF(ISBLANK([Cell]@row), "Yellow", (IF([Cell]@row = 0, "Green", "Red")))

Appreciate assistance. Thank you.

• ✭✭✭✭✭✭

Hi @Vivien Chong

Hope you are fine, please try the following formula and convert it to column formula:

=IF(ISBLANK(Amount@row), "Yellow", IF(AND(Amount@row <= 20, Amount@row >= -20), "Green", "Red"))

bassam.khalil2009@gmail.com

• ✭✭✭✭✭✭

Hi @Vivien Chong

Hope you are fine, please try the following formula and convert it to column formula:

=IF(ISBLANK(Amount@row), "Yellow", IF(AND(Amount@row <= 20, Amount@row >= -20), "Green", "Red"))

bassam.khalil2009@gmail.com

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!