Help with calculating health (R/Y/G/B) based on end date and % complete
Hi,
I'm trying to create a formula to auto calculate the health of a task and return the correct R/Y/G/B ball based on the % complete measured against the planned duration and start/finish dates. I created a couple of helper columns (one calculating 50% & one calculating 75% of the duration as a number) to attempt to get the formula down, but I'm not having any luck. eg. if a task that has a 10 day duration is only 25% complete and there is 2 days left it would be marked "Red".
The criteria I want to use is:
- If the start date is in the future and if the % complete is 0 don't show any color ball
- If today is less than 50% of the task duration and % complete is less than 50% show green
- If today is more than 50% of the task duration and % complete is less than 50% show yellow
- If today is more than 75% of the task duration and % complete is less than 75% show red
- If % complete is 100% show blue
The formula I was trying (that is not working) is:
=如果今天((()<([开始]@row)(%完成)@row = 0), ""), IF(AND(TODAY() < ([End Date]@row - [At Risk Helper .5]@row), [% Complete]@row < 0.5), "Green"), IF(AND(TODAY() > ([End Date]@row - [At Risk Helper .5]@row), [% Complete]@row < 0.5), "Yellow"), IF(AND(TODAY() > ([End Date]@row - [At Risk Helper .75]@row), [% Complete]@row < 0.75), "Red"), IF([% Complete]@row = 1, "Blue")))))
My columns are as follows:
- At Risk Helper .75 & At Risk Helper .5 - Text/Number
- Task Health - Symbol (R/Y/G/B)
- Task Name - Primary Column so Text/Number
- Duration - Duration
- Start Date & End Date - Date
I'd be very grateful if someone can assist!
*Edited to add the additional ')' at the end of my formula.
Thanks,
Laurie
Best Answer
-
Genevieve P. Employee Admin
Hi Laurie,
It looks like you just added in some extra closing parenthesis at the end of each IF statement, which would cause the formula to error. Try this:
=IF(AND(TODAY() < [Start Date]@row, [% Complete]@row = 0), "", IF(AND(TODAY() < ([End Date]@row - [At Risk Helper .5]@row), [% Complete]@row < 0.5), "Green", IF(AND(TODAY() > ([End Date]@row - [At Risk Helper .5]@row), [% Complete]@row < 0.5), "Yellow", IF(AND(TODAY() > ([End Date]@row - [At Risk Helper .75]@row), [% Complete]@row < 0.75), "Red", IF([% Complete]@row = 1, "Blue")))))
You'll notice that I kept each IF statement open at the end, so that it can move on and read the next statement. I then closed off each IF statement only at the very end of the whole formula. I haven't actually tested it for each of your criteria, so if you're finding that this doesn't return the proper result, could you explain how you get the helper number in your two helper columns?
Thanks!
Genevieve
Answers
-
Genevieve P. Employee Admin
Hi Laurie,
It looks like you just added in some extra closing parenthesis at the end of each IF statement, which would cause the formula to error. Try this:
=IF(AND(TODAY() < [Start Date]@row, [% Complete]@row = 0), "", IF(AND(TODAY() < ([End Date]@row - [At Risk Helper .5]@row), [% Complete]@row < 0.5), "Green", IF(AND(TODAY() > ([End Date]@row - [At Risk Helper .5]@row), [% Complete]@row < 0.5), "Yellow", IF(AND(TODAY() > ([End Date]@row - [At Risk Helper .75]@row), [% Complete]@row < 0.75), "Red", IF([% Complete]@row = 1, "Blue")))))
You'll notice that I kept each IF statement open at the end, so that it can move on and read the next statement. I then closed off each IF statement only at the very end of the whole formula. I haven't actually tested it for each of your criteria, so if you're finding that this doesn't return the proper result, could you explain how you get the helper number in your two helper columns?
Thanks!
Genevieve
-
Laurie A ✭✭
Thank you, thank you, thank you!
That was a big oversight on my part. I actually took that and tweaked it a bit, in part because after writing it out I realized that it should have been "<=" or ">=" in some cases. I also switched around a few things to ensure that the order of operations was accurate. As an added bonus by changing it up I was able to streamline it to make it a bit more efficient. So the final formula that works as I had envisioned is as follows:
=IF([% Complete]@row = 1, "Blue", IF(AND(TODAY() < [Start Date]@row, [% Complete]@row <= 1), "", IF(AND(TODAY() <= ([End Date]@row - [At Risk Helper .5]@row), [% Complete]@row < 1), "Green", IF(AND(TODAY() >= ([End Date]@row - [At Risk Helper .5]@row), [% Complete]@row <= 0.75), "Yellow", IF(AND(TODAY() >= ([End Date]@row - [At Risk Helper .75]@row), [% Complete]@row < 1), "Red")))))
To answer your questions about the helper columns they were simple mathematics formulas (=Duration@row*.5 or =Duration@row*.75).
Again, thank you for your help.
Best,
Laurie
-
Genevieve P. Employee Admin
Oh wonderful! I'm so glad that I was able to help, and that you were able to create a final formula that works!!
Let me know if you have any other issues.
Cheers,
Genevieve
Help Article Resources
Categories
Check out theFormula Handbook template!
Instead of applying the formula to \"Multiselect Text String\" row, did you tried with \"Multiselect Values\" row?<\/p>
=IF(HAS([Multiselect Values]@row, [Component ID]@row), \"MATCH\", \"NO MATCH\")<\/p>
Thank you,<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]},{"discussionID":109493,"type":"question","name":"I am having trouble using \"And\", \"OR\" & \"Countif(s)\" to build a formula.","excerpt":"Hello, I am attempting to come up with a sheet summary formula that counts cells if they meet at least one of 3 different statuses in the same column, AND also meet one of 5 different statuses in a separate column. So using the screenshot I've provided as an example (although it doesn't have 5 different statuses in the…","snippet":"Hello, I am attempting to come up with a sheet summary formula that counts cells if they meet at least one of 3 different statuses in the same column, AND also meet one of 5…","categoryID":322,"dateInserted":"2023-08-25T20:03:21+00:00","dateUpdated":null,"dateLastComment":"2023-08-26T00:34:49+00:00","insertUserID":165710,"insertUser":{"userID":165710,"name":"SmarsheetNewb","url":"https:\/\/community.smartsheet.com\/profile\/SmarsheetNewb","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-26T00:33:27+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":161714,"lastUser":{"userID":161714,"name":"Carson Penticuff","url":"https:\/\/community.smartsheet.com\/profile\/Carson%20Penticuff","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/B0Q390EZX8XK\/nBGT0U1689CN6.jpg","dateLastActive":"2023-08-26T01:04:51+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":22,"score":null,"hot":3386005690,"url":"https:\/\/community.smartsheet.com\/discussion\/109493\/i-am-having-trouble-using-and-or-countif-s-to-build-a-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/109493\/i-am-having-trouble-using-and-or-countif-s-to-build-a-formula","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":109493,"commentID":392692,"name":"Re: I am having trouble using \"And\", \"OR\" & \"Countif(s)\" to build a formula.","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392692#Comment_392692","dateInserted":"2023-08-26T00:34:49+00:00","insertUserID":161714,"insertUser":{"userID":161714,"name":"Carson Penticuff","url":"https:\/\/community.smartsheet.com\/profile\/Carson%20Penticuff","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/B0Q390EZX8XK\/nBGT0U1689CN6.jpg","dateLastActive":"2023-08-26T01:04:51+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-26T00:33:25+00:00","dateAnswered":"2023-08-25T20:44:12+00:00","acceptedAnswers":[{"commentID":392662,"body":"
Try this:<\/p>
=COUNTIFS([Item Number]:[Item Number], OR(@cell = \"C001\", @cell = \"COO2\", @cell = \"COO3\", @cell = \"COO4\"), [Status]:[Status], OR(@cell = \"Green\", @cell = \"Yellow\", @cell = \"Red\"))<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":254,"urlcode":"formulas","name":"Formulas"}]},{"discussionID":109474,"type":"question","name":"Help with date calculation formula","excerpt":"Hello, I'm trying to find a formula that will help me calculate how long an intake took to resolve. The rows I need to be calculated are Date Reported & Resolution Date. If the resolution date is blank I want it to use the current date in the calculation to see how long this issue has gone unresolved. Any help is much…","snippet":"Hello, I'm trying to find a formula that will help me calculate how long an intake took to resolve. The rows I need to be calculated are Date Reported & Resolution Date. If the…","categoryID":322,"dateInserted":"2023-08-25T16:29:39+00:00","dateUpdated":"2023-08-25T16:29:59+00:00","dateLastComment":"2023-08-25T23:01:30+00:00","insertUserID":165688,"insertUser":{"userID":165688,"name":"Nwest","title":"Systems Analyst","url":"https:\/\/community.smartsheet.com\/profile\/Nwest","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!ukHVZ18ImX4!BcjWAe8S9SY!l7iQo_PZHOx","dateLastActive":"2023-08-25T17:22:30+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":165688,"lastUserID":8888,"lastUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-08-26T17:06:33+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":23,"score":null,"hot":3385987269,"url":"https:\/\/community.smartsheet.com\/discussion\/109474\/help-with-date-calculation-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/109474\/help-with-date-calculation-formula","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":109474,"commentID":392687,"name":"Re: Help with date calculation formula","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392687#Comment_392687","dateInserted":"2023-08-25T23:01:30+00:00","insertUserID":8888,"insertUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-08-26T17:06:33+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-25T17:04:22+00:00","dateAnswered":"2023-08-25T16:36:59+00:00","acceptedAnswers":[{"commentID":392622,"body":"