Help with formula: if Status is X and End Date is in X days, change symbol to X
Hello - I am looking for help with a formula that states:
If "Status" is not "Complete" and the "End Date" is 5 biz days or less from today - change symbol to Red
If "Status" is not "Complete" and the "End Date" is within 6-10 biz days from today - change symbol to yellow
If "Status" is "Complete" OR the "End Date" is 11+ biz days from today - change symbol to green
See # of days until the due date calculated below. Given the desired logic above, the item due in 6 days should be yellow and the item due in 11 days should be green.
Days From Today Until Due =NETWORKDAYS(TODAY(1), [End Date]@row)
This is the formula used for Health:
=IF(AND(Status@row <> "Complete", [End Date]@row - 5 <= TODAY(5)), "Red", IF(AND(Status@row <> "Complete", [End Date]@row - 10 <= TODAY(10)), "Yellow", IF(OR(Status@row = "Complete", [End Date]@row - 11 >= TODAY(11)), "Green")))
Thanks!!
Best Answer
-
@Darren Mullen - That worked perfectly! Thank you!
Full formula for reference:
=IF(AND(Status@row <> "Complete", ([End Date]@row - TODAY()) <= 5, ([End Date]@row - TODAY()) >= 0), "Red", IF(AND(Status@row <> "Complete", ([End Date]@row - TODAY()) <= 10, ([End Date]@row - TODAY()) >= 6), "Yellow", IF(OR(Status@row = "Complete", ([End Date]@row - TODAY()) >= 11), "Green")))
Answers
-
@Kadie M You're making a lot of adjustments to the dates by subtracting from the End Date as well as adding days to Today's date.
It would be more straightforward if you did something like this:
=IF(AND(Status@row <> "Complete", ([End Date]@row - Today()) <= 5, ([End Date]@row - Today()) >= 0), "Red" ..............
Darren Mullen, join the Smartsheet Guru Elite
Get my 7 Smartsheet tips here
Author of: Smartsheet Architecture Solutions
-
@Darren Mullen - That worked perfectly! Thank you!
Full formula for reference:
=IF(AND(Status@row <> "Complete", ([End Date]@row - TODAY()) <= 5, ([End Date]@row - TODAY()) >= 0), "Red", IF(AND(Status@row <> "Complete", ([End Date]@row - TODAY()) <= 10, ([End Date]@row - TODAY()) >= 6), "Yellow", IF(OR(Status@row = "Complete", ([End Date]@row - TODAY()) >= 11), "Green")))
-
@Kadie M You're welcome, however I realized I lead you a little astray. You probably don't want this condition in there ([End Date]@row - TODAY()) >= 0)
If you leave that in, then it won't turn red when the end date is greater than today!
Sorry, I wasn't thinking it all the way through yesterday.
Darren Mullen, join the Smartsheet Guru Elite
Get my 7 Smartsheet tips here
Author of: Smartsheet Architecture Solutions
-
@Darren Mullen - You are right and no worries at all! I removed that piece and it's working perfectly. Thanks again for your help!!
=IF(AND(Status@row <> "Complete", ([End Date]@row - TODAY()) <= 5), "Red", IF(AND(Status@row <> "Complete", ([End Date]@row - TODAY()) <= 10, ([End Date]@row - TODAY()) >= 6), "Yellow", IF(OR(Status@row = "Complete", ([End Date]@row - TODAY()) >= 11), "Green")))
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 65.2K Get Help
- 445 Global Discussions
- 143 Industry Talk
- 476 Announcements
- 5K Ideas & Feature Requests
- 84 Brandfolder
- 150 Just for fun
- 71 Community Job Board
- 488 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 301 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!