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
-
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
-
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
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 68K Get Help
- 474 Global Discussions
- 209 Use Cases
- 517 Announcements
- 5.6K Ideas & Feature Requests
- 87 Brandfolder
- 157 Just for fun
- 85 Community Job Board
- 521 Show & Tell
- 36 Member Spotlight
- 3 SmartStories
- 309 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!