Using "Flag" in and IF function
Hello!
I am looking to create a formula for the RYG column that would work like this:
If Status column is "Overdue", then it shows "Yellow"
If Status column is "Complete", then it shows "Green"
If Status column is "In Progress", then it shows "Green"
If Status column is "Not Started", then it shows "Grey"
If At Risk column is flagged, then it shows "Red"
I have been trying this, but the At Risk flag doesn't trigger Red.
=IF(Status@row = "Overdue", "Yellow", IF(Status@row = "Complete", "Green", IF(Status@row = "In Progress", "Green", IF(Status@row = "Not Started", "Gray", IF([At Risk]@row = 1, "Red")))))
Any ideas?
Best Answer
-
I think the issue is the order of your conditions. The formula is parsed in the order you write it, so as soon as a condition is "true," Smartsheet stops evaluating conditions. That means, for example, that as soon as Smartsheet sees a status is "Overdue," it puts the yellow ball in your symbol column and stops evaluating the rest of the conditions, including the "At Risk" flag.
Try this (using the right titles for your columns):
=IF([At Risk]@row = 1, "Red", IF(Status@row = "Overdue", "Yellow", IF(OR(Status@row = "Complete", Status@row = "In Progress"), "Green", IF(Status@row = "Not Started", "Gray", "Gray"))))
Answers
-
I think the issue is the order of your conditions. The formula is parsed in the order you write it, so as soon as a condition is "true," Smartsheet stops evaluating conditions. That means, for example, that as soon as Smartsheet sees a status is "Overdue," it puts the yellow ball in your symbol column and stops evaluating the rest of the conditions, including the "At Risk" flag.
Try this (using the right titles for your columns):
=IF([At Risk]@row = 1, "Red", IF(Status@row = "Overdue", "Yellow", IF(OR(Status@row = "Complete", Status@row = "In Progress"), "Green", IF(Status@row = "Not Started", "Gray", "Gray"))))
-
Amazing! Thank you, it worked!! I will remember this.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!