If Formula RGY with numbers greater than, less than and zero

Trying to get the RGY to flip based on a number value (Budget Variance). As written, yellow works but the Red and Green don't. Any ideas?

Formula I'm using:

=IF([Budget Variance]@row = "0", "Yellow", IF([Budget Variance]@row = ">0", "Green", IF([Budget Variance]@row = "<0", "Red")))


Thanks in advance!

Best Answers

  • Smartsheet User 99
    Smartsheet User 99 ✭✭✭
    Answer ✓

    =IF(ISBLANK([Budget Variance]@row), "", IF([Budget Variance]@row = 0, "Yellow", IF([Budget Variance]@row > 0, "Green", IF([Budget Variance]@row < 0, "Red"))))

    I created an IF(ISBLANK(), if not and there are no numbers in Budget Variance, it'll just default to "Yellow"

    "Without IF(ISBLANK)"

    "With IF(ISBLANK()"

    I also got rid of the equal sign for green and red because we already have a statement that equals 0. We're going to need to return colors based on numbers greater than 0 or less than 0.


  • Paul H
    Paul H ✭✭✭✭✭✭
    Answer ✓

    Try this

    =IF([Budget Variance]@row = 0, "Yellow", IF([Budget Variance]@row > 0, "Green", IF([Budget Variance]@row < 0, "Red")))

Answers

  • Smartsheet User 99
    Smartsheet User 99 ✭✭✭
    Answer ✓

    =IF(ISBLANK([Budget Variance]@row), "", IF([Budget Variance]@row = 0, "Yellow", IF([Budget Variance]@row > 0, "Green", IF([Budget Variance]@row < 0, "Red"))))

    I created an IF(ISBLANK(), if not and there are no numbers in Budget Variance, it'll just default to "Yellow"

    "Without IF(ISBLANK)"

    "With IF(ISBLANK()"

    I also got rid of the equal sign for green and red because we already have a statement that equals 0. We're going to need to return colors based on numbers greater than 0 or less than 0.


  • Paul H
    Paul H ✭✭✭✭✭✭
    Answer ✓

    Try this

    =IF([Budget Variance]@row = 0, "Yellow", IF([Budget Variance]@row > 0, "Green", IF([Budget Variance]@row < 0, "Red")))

  • Thank you, Community! Both suggestions given worked and I learned from them re: where I was going wrong, really appreciate it!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!