Current Task Formula based off certain criteria (symbols)

嗨,

I want to create a formula that would read all rows have a Green symbol and read back the last task name that has green. This would have to be based off the row number and not dates, given not every task will have a start or end date.

Attachment for context --> I would want the formula to read all of those tasks and deliver back "presentations task" since that is the last Green row.

Screen Shot 2018-12-17 at 6.28.49 PM.png

Comments

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Would it be possible to have a few greens, a few yellows, then a few more greens? If so, how would you determine which is the last green? If not I would assume that row 2 will never be green before row 1, row 3 would never be green before row 2, etc.

    Both scenarios are possible to account for in a formula, but they do require very different formulas.

    thinkspi.com

  • 嗨Paul,

    Thanks for helping out. I'd say having green come after a yellow status would be unlikely. The goal is to show the last green row. This would be based on the number of the row. So green in row 22 would be the last and the row I'd like to show. This formula would have to update as tasks are checked off as green.

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Ok. And are all of the rows you are looking at children rows of another, or are you strictly looking at them as individual rows with the intention of having the last one marked green displayed elsewhere on the sheet such as at the top or in a summary?

    thinkspi.com

  • Brian W
    Brian W ✭✭

    I’m curious what Paul comes up with but here is what I would do:

    I would create a helper column that checks if the current row’s cell in the RYG column is green and counts the greens in the cells below that one. If the cell is green and there are 0 green cells below it, it assigns a 1. This formula goes in the first cell of the helper column and assumes you have 50 rows of data:

    =IF(AND(RYGColumn1 = "green", COUNTIF(RYGColumn2:RYGColumn$50, ="green") < 1), 1,0)

    Then I would use INDEX/MATCH to find the 1 in the GreenHelper column and return the corresponding cell in the Number column:

    =INDEX(Number:Number, MATCH(1, GreenHelper:GreenHelper))

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    @Brian

    If they are all children rows that are being looked at, and the data will be displayed in the parent row along side the parent row task, and there will never be a green lower than a yellow, then I would be joining the parent row task text with the child row task with something along the lines of

    ="Parent Row Text - " + INDEX(CHILDREN(), COUNTIFS(CHILDREN([RYG Column Name]@row), "Green"))

    Using the screenshot provided in the original post, the Parent cell would read something along the lines of

    Parent row text from row 18 - Presentations

    thinkspi.com

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the公式手册模板!
@SarahI<\/a> Yes you can do that just use CHILDREN([COLUMN NAME])<\/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":106886,"type":"question","name":"Risk and Opportunity Matrix - IF\/AND Statements","excerpt":"Hello, I am trying to utilize a Risk & Opportunity Matrix to assign priority levels to risks and opportunities. I am using this formula to try to do this but I keep getting an #INCORRECT ARGUMENT. Does anyone know why? I even tried a test with only one IF\/AND statement to see if it works and I still get the same message.…","categoryID":322,"dateInserted":"2023-06-26T13:58:31+00:00","dateUpdated":"2023-06-26T14:10:30+00:00","dateLastComment":"2023-06-26T15:19:16+00:00","insertUserID":162759,"insertUser":{"userID":162759,"name":"sophiaashepard","title":"Project Manager","url":"https:\/\/community.smartsheet.com\/profile\/sophiaashepard","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-26T15:30:21+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":162759,"lastUserID":45516,"lastUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-06-26T16:21:56+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":21,"score":null,"hot":3375581867,"url":"https:\/\/community.smartsheet.com\/discussion\/106886\/risk-and-opportunity-matrix-if-and-statements","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106886\/risk-and-opportunity-matrix-if-and-statements","format":"Rich","lastPost":{"discussionID":106886,"commentID":382299,"name":"Re: Risk and Opportunity Matrix - IF\/AND Statements","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/382299#Comment_382299","dateInserted":"2023-06-26T15:19:16+00:00","insertUserID":45516,"insertUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-06-26T16:21:56+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/AXPIZGR6E5VK\/matrix-png.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"Matrix.PNG"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-26T15:30:19+00:00","dateAnswered":"2023-06-26T15:19:16+00:00","acceptedAnswers":[{"commentID":382299,"body":"

Looks like you are forgetting to close out your AND function(s).<\/p>

=IF(AND(.......), <\/strong>\"Critical\")<\/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":106881,"type":"question","name":"Calculate % complete with Date Range and Today's date","excerpt":"Hello community, I need a formula to return % Complete based on a start - end date range and today's date. So for example: Date Range: 06\/18\/23 - 06\/30\/23 Today's date: 06\/26\/23 As there are 12days in this date range, and today's date is day 8 out of 12, the percentage complete would be 66.6% Thanks in advance!","categoryID":322,"dateInserted":"2023-06-26T11:40:17+00:00","dateUpdated":null,"dateLastComment":"2023-06-26T15:14:49+00:00","insertUserID":143463,"insertUser":{"userID":143463,"name":"Sam Swain","url":"https:\/\/community.smartsheet.com\/profile\/Sam%20Swain","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-26T15:15:08+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":null,"lastUserID":45516,"lastUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-06-26T16:21:56+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":6,"countViews":44,"score":null,"hot":3375575706,"url":"https:\/\/community.smartsheet.com\/discussion\/106881\/calculate-complete-with-date-range-and-todays-date","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106881\/calculate-complete-with-date-range-and-todays-date","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":106881,"commentID":382293,"name":"Re: Calculate % complete with Date Range and Today's date","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/382293#Comment_382293","dateInserted":"2023-06-26T15:14:49+00:00","insertUserID":45516,"insertUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-06-26T16:21:56+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-26T13:50:37+00:00","dateAnswered":"2023-06-26T13:24:44+00:00","acceptedAnswers":[{"commentID":382268,"body":"

=MAX(MIN((TODAY() - Start@row) \/ (Finish@row - Start@row), 1), 0)<\/p>


<\/p>

This does the percentage:<\/p>

(TODAY() - Start@row) \/ (Finish@row - Start@row)<\/p>


<\/p>

This caps it at 100%:<\/p>

MIN(..............., 1)<\/p>


<\/p>

This keeps it from going negative for future tasks:<\/p>

MAX(..............., 0)<\/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