需要帮助的公式使用健康圣atus and dates

Smartsheet.JPG


Hi,

I'm trying to do a formula in the "Health" column. Once we are within 30 days from the due date, the status turns "Yellow" and once it is within 7 days of the due date and past it, the status would be "Red". Any other status would be green. I'm at a lost to where even to begin even after viewing some of the videos. If you've seen this before or have experience can you point me in the right direction?


Thanks,

Allison

Answers

  • Kelly Moore
    Kelly Moore ✭✭✭✭✭✭
    edited 10/27/20

    Hi Allison,

    I made an assumption that your sheet also had a column (which I called Status) that would indicate if the task was Complete. Make sure you update this formula to your actual column name and edit my word 'Completed' to your actual wording. Note the wording is case sensitive.

    Add this formula to your Health column. The ball will turn green if the Status is Complete, or if the Due Date is 30 d or more greater than Today. The ball will turn Red if the Due Date is within 7 d or less than today. Anything in between will turn to yellow.

    =IF(OR(Status@row = "Completed", [Due Date]@row - TODAY() >= 30), "Green", IF([Due Date]@row - TODAY() <= 7, "Red", "Yellow"))

    I hope this helps

    Kelly

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out theFormula Handbook template!
Hello and welcome!<\/p>

If your Program list in Sheet 2 is written out to match the option in your form and entries in Sheet 2, then you can just reference those for look up:<\/p>

=COUNTIF({Task Request Range 1},=Program@row)<\/p>

Where \"Program\" is the actual column header you have the list Auto Doors, Baler, Compactors, etc.<\/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":111081,"type":"question","name":"Combining selected cells into one cell ignoring blanks?","excerpt":"Hello all, I am trying to combine cell into one cell and I have found a couple other community posts covering this issue. The only problem is that their solution only applies if you are trying to collect the entire row, I need specific row. Originally, I did this just by using JOIN and then selecting each cell, separated…","snippet":"Hello all, I am trying to combine cell into one cell and I have found a couple other community posts covering this issue. The only problem is that their solution only applies if…","categoryID":322,"dateInserted":"2023-10-02T20:25:16+00:00","dateUpdated":null,"dateLastComment":"2023-10-02T21:09:01+00:00","insertUserID":167760,"insertUser":{"userID":167760,"name":"toca1","title":"User","url":"https:\/\/community.smartsheet.com\/profile\/toca1","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-10-02T21:06:06+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":167760,"lastUser":{"userID":167760,"name":"toca1","title":"User","url":"https:\/\/community.smartsheet.com\/profile\/toca1","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-10-02T21:06:06+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":6,"countViews":42,"score":null,"hot":3392562857,"url":"https:\/\/community.smartsheet.com\/discussion\/111081\/combining-selected-cells-into-one-cell-ignoring-blanks","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/111081\/combining-selected-cells-into-one-cell-ignoring-blanks","format":"Rich","tagIDs":[254,587,590],"lastPost":{"discussionID":111081,"commentID":397984,"name":"Re: Combining selected cells into one cell ignoring blanks?","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/397984#Comment_397984","dateInserted":"2023-10-02T21:09:01+00:00","insertUserID":167760,"insertUser":{"userID":167760,"name":"toca1","title":"User","url":"https:\/\/community.smartsheet.com\/profile\/toca1","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-10-02T21:06:06+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-10-02T20:53:50+00:00","dateAnswered":"2023-10-02T20:52:20+00:00","acceptedAnswers":[{"commentID":397979,"body":"

@toca1<\/a> Yes, you can do that, or you can create helper columns that grab the text from the cells you want and apply the formula to those instead.<\/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"},{"tagID":587,"urlcode":"join","name":"Join"},{"tagID":590,"urlcode":"collect","name":"collect"}]},{"discussionID":111067,"type":"question","name":"Using Parent Rows in Reference Another Sheet Formula","excerpt":"I'm attempting to calculate the total number of pediatric calls by county using this formula all referencing another sheet: =SUMIF(PARENT({MAHEC County}, \"Buncombe\"), {Pediatric Calls}) However, it is not working. Any suggestions?","snippet":"I'm attempting to calculate the total number of pediatric calls by county using this formula all referencing another sheet: =SUMIF(PARENT({MAHEC County}, \"Buncombe\"), {Pediatric…","categoryID":322,"dateInserted":"2023-10-02T18:30:27+00:00","dateUpdated":null,"dateLastComment":"2023-10-02T19:57:49+00:00","insertUserID":140061,"insertUser":{"userID":140061,"name":"Courtney Coules","url":"https:\/\/community.smartsheet.com\/profile\/Courtney%20Coules","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!BZVSAQCS84Q!e4DTJ4zdIvY!tXH_G0wXGEj","dateLastActive":"2023-10-02T19:04:16+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":null,"lastUserID":163506,"lastUser":{"userID":163506,"name":"JamesB","title":"IT Project Manager","url":"https:\/\/community.smartsheet.com\/profile\/JamesB","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/avatarstock\/nEQMY42MFGXWS.png","dateLastActive":"2023-10-02T21:49:49+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":23,"score":null,"hot":3392549896,"url":"https:\/\/community.smartsheet.com\/discussion\/111067\/using-parent-rows-in-reference-another-sheet-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/111067\/using-parent-rows-in-reference-another-sheet-formula","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":111067,"commentID":397953,"name":"Re: Using Parent Rows in Reference Another Sheet Formula","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/397953#Comment_397953","dateInserted":"2023-10-02T19:57:49+00:00","insertUserID":163506,"insertUser":{"userID":163506,"name":"JamesB","title":"IT Project Manager","url":"https:\/\/community.smartsheet.com\/profile\/JamesB","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/avatarstock\/nEQMY42MFGXWS.png","dateLastActive":"2023-10-02T21:49:49+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-10-02T18:58:52+00:00","dateAnswered":"2023-10-02T18:57:41+00:00","acceptedAnswers":[{"commentID":397932,"body":"

We can't use hierarchy based functions with cross sheet references. You will need to insert a helper column on the source sheet (can be hidden after setting up) that pulls the parent row data onto every row. Then you would reference this column in your formula with the cross sheet reference.<\/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"}]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&categoryID=322&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&sort=-hot&limit=3&expand%5B0%5D=all&expand%5B1%5D=-body&expand%5B2%5D=insertUser&expand%5B3%5D=lastUser&status=accepted","prevURL":null,"currentPage":1,"total":10000,"limit":3},"title":"Trending in Formulas and Functions ","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

Trending in Formulas and Functions