Formulas and Functions

Formulas and Functions

Ask for help with your formula and find examples of how others use formulas and functions to solve a similar problem.

Help with IF functions

I want to create a function that basically says

If, the Due Date is is more than 14 days past due I want red

If " " is less than 14 yellow

On date green


This is what I have so far

=IF([Due Date]@row < Today(-14), "Red"), IF([Due Date]@row < Today(-13), "Yellow"), IF([Due Date]@row, TODAY(), "Green")))


Getting a #UNPARSED error. Can anyone help?

Best Answer

  • Employee
    Answer ✓

    Hi @dlittl02

    You're close! With nested IF Statements you'll want to leave the closing parentheses to the very end of the entire formula instead of closing it off right after you say "Red") etc.

    You're also missing >= before your final statement, where if the Due Date is either equal to or greater than today, it should be Green.

    Try this:

    =IF([Due Date]@row < TODAY(-14), "Red", IF([Due Date]@row < TODAY(), "Yellow", IF([Due Date]@row >= TODAY(), "Green")))

    Actually, you can simplify this since you already have statements for in the past: you can skip the entire last statement and say if it's not Red or Yellow, it should be Green, like so:

    =IF([Due Date]@row < TODAY(-14), "Red", IF([Due Date]@row < TODAY(), "Yellow", "Green"))


    Let me know if this works for you!

    Cheers,

    Genevieve

    Need more information? 👀 | Help and Learning Center

    こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao!👋 | Global Discussions

Answers

  • Employee
    Answer ✓

    Hi @dlittl02

    You're close! With nested IF Statements you'll want to leave the closing parentheses to the very end of the entire formula instead of closing it off right after you say "Red") etc.

    You're also missing >= before your final statement, where if the Due Date is either equal to or greater than today, it should be Green.

    Try this:

    =IF([Due Date]@row < TODAY(-14), "Red", IF([Due Date]@row < TODAY(), "Yellow", IF([Due Date]@row >= TODAY(), "Green")))

    Actually, you can simplify this since you already have statements for in the past: you can skip the entire last statement and say if it's not Red or Yellow, it should be Green, like so:

    =IF([Due Date]@row < TODAY(-14), "Red", IF([Due Date]@row < TODAY(), "Yellow", "Green"))


    Let me know if this works for you!

    Cheers,

    Genevieve

    Need more information? 👀 | Help and Learning Center

    こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao!👋 | Global Discussions

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!

Trending in Formulas and Functions