Formula for project status based on where a project is at
How would I write a formula to automatically populate a status column with red, yellow, or green based on where the project is at? In the screen shot below the Implement Asset Works is on-track because the gantt bar is filled in to the dotted line. The Implement Salesforce is behind schedule since the gantt bar is only partially filled in.
What I would like to do is have the Status be green if the project is on-track or less than 1 week behind. If the project is between 1-3 weeks behind then yellow. If the project is more than 3 weeks behind then red. Thoughts on how to accomplish this?
Best Answer
-
Hi @belmer
You need to calculate different things first here to do what you want.
NETWORKDAYS([Start date]@row, TODAY()) / NETWORKDAYS([Start date]@row, [End date]@row) will get you the theorical % of the project.
(5 / (NETWORKDAYS([Start date]@row; [End date]@row))) will get you the % to do within a week (considering 5 working days within a week).
(15 / NETWORKDAYS([Start date]@row; [End date]@row)) will get you the % to do within 3 weeks.
That makes a lots of calculation to do within one cell. So I would suggest using some helper cells to make it easier here with shorter and quicker formulas. But anyway, here it is.
=IF(NETWORKDAYS([Start date]@row, TODAY()) / NETWORKDAYS([Start date]@row, [End date]@row) - (5 / (NETWORKDAYS([Start date]@row; [End date]@row))) <= [% Complete]@row, "Green", IF(NETWORKDAYS([Start date]@row, TODAY()) / NETWORKDAYS([Start date]@row, [End date]@row) - (15 / NETWORKDAYS([Start date]@row; [End date]@row)) <= [% Complete]@row, "Yellow", "Red"))
Hope it helped!
Answers
-
Hi @belmer
You need to calculate different things first here to do what you want.
NETWORKDAYS([Start date]@row, TODAY()) / NETWORKDAYS([Start date]@row, [End date]@row) will get you the theorical % of the project.
(5 / (NETWORKDAYS([Start date]@row; [End date]@row))) will get you the % to do within a week (considering 5 working days within a week).
(15 / NETWORKDAYS([Start date]@row; [End date]@row)) will get you the % to do within 3 weeks.
That makes a lots of calculation to do within one cell. So I would suggest using some helper cells to make it easier here with shorter and quicker formulas. But anyway, here it is.
=IF(NETWORKDAYS([Start date]@row, TODAY()) / NETWORKDAYS([Start date]@row, [End date]@row) - (5 / (NETWORKDAYS([Start date]@row; [End date]@row))) <= [% Complete]@row, "Green", IF(NETWORKDAYS([Start date]@row, TODAY()) / NETWORKDAYS([Start date]@row, [End date]@row) - (15 / NETWORKDAYS([Start date]@row; [End date]@row)) <= [% Complete]@row, "Yellow", "Red"))
Hope it helped!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!