Sum(Children())

Another basic question - I have a column that uses the value in the 'Remaining Effort' to calculate the status of that task.

At the Parent Level I am using Sum(Children()) to sum the Remaining Effort for the Child tasks. This works fine as long as there is a value in this field - if the Task has not started and 'Remaining Effort' is blank then the Sum(Children()) formula will return '0', which is then used to indicate that the Parent Task is complete, which is obviously not correct.

Is it possible to modify the Sum(Children()) formula so that it only sums Child Tasks if their values are not blank? If all the values are blank then it should return "".

Thanks for sharing your expertise!


Nigel

Best Answers

  • David Joyeuse
    David Joyeuse ✭✭✭✭✭
    Answer ✓

    Hi@Nigel Michell

    Sorry for the delay, I've been a little bit too busy to come back to you.

    Row 4B, to me, is nothing more than an helper column you hide. I like to have this row which can help greatly in card view, if you use it . It's also great to make it easier to differentiate parents from childrens on the grid with conditional formatting as you can apply a specific line color, font, character hieght, and so on based on this column. It really helps having a cleaner sheet to work with.

    Now regarding the calculated status column:

    =IF([Time Spent (Hours)]@row > 0, IF([% Comp]@row = 1, “Complete”, IF([% Comp]@row = 0, “Not Started”, “In Progress”)), “Not Started”)

    As, I think@Genevieve Ppointed it out on another thread, you'll note that quotes here are a little bit curved as the formula is being paste from Word. They should be straight.

    Try copy/paste this formula:

    =IF([Time Spent (Hours)]@row>0; IF([% Comp]@row = 1, "Complete", IF([% Comp]@row = 0, "Not Started", "In Progress")), "Not Started")

    That one is a little tricky, but the problem comes from the quotes.

  • Nigel Michell
    Answer ✓

    Thanks@David Joyeuse

    I copied the formula and then I manually changed the quote marks to ensure that they were correct but Smartsheet still says the formula is Unparseable.

    This is what I pasted:

    =IF([Time Spent (Hours)]@row>0; IF([% Comp]@row = 1, "Complete", IF([% Comp]@row = 0, "Not Started", "In Progress")), "Not Started")

    Looking at this now I can see what the problem is - there is a semi colon rather than comma after the first 'If'!

    It now works!

    Many thanks again for your time

«1

Answers

  • David Joyeuse
    David Joyeuse ✭✭✭✭✭

    Hi@Nigel Michell

    That would be:

    =如果条件统计(孩子(),NOT(ISBLANK(@cell)))=COUNT(CHILDREN([Main Column]@row)),SUM(CHILDREN()),"")

    But reading you the problem does not lies in the SUM(CHILDREN()) but in the fact that when the task as not started, the remaining effort is blank.

    Following your logic, since you want to display what remains to do, shouldn't be the remaining effort be 100% when the task is not started?

  • Hi@David Joyeuse

    Thanks for such a quick reply - it looks very complicated!

    When I try to use it, it comes back as #UNPARSEABLE - am I doing something wrong?

  • David Joyeuse
    David Joyeuse ✭✭✭✭✭

    @Nigel Michell

    Maybe it comes from [Main Column], I used it as a placeholder to designated the name of your main column on your sheet. That's a thing I often due because for whatever reason, comparing COUNTIF(CHILDREN()) and COUNT(CHILDREN()) often returns error to me if I do not specify another column...

  • Sorry - yes - did not notice that!

    Will convert the value to the Column Name

  • David Joyeuse
    David Joyeuse ✭✭✭✭✭

    It seems all of your children are at 0, so getting 0seems fine to me.

    Watch out, for Smartsheet being Blank is different than being equal to 0.

    So maybe you try this workaround:

    =如果条件统计(孩子(),OR(NOT(ISBLANK(@cell)), @cell<>0))=COUNT(CHILDREN([Main Column]@row)),SUM(CHILDREN()),"")

    Here we'll check if the cell is blank or if children is equal to 0 and SUM will happen only when all cell will be filled with a number that is not 0.

  • @David Joyeuse

    Sorry I am obviously not explaining this well. If the value in Remaining Effort is 0 then the Task is complete and the 0 should be calculated.

    The issue relates to the cells under the Orange row. The Child Tasks under the Orange Parent row have not started therefore the cells are empty. If the Child tasks are blank then the Parent Task should also be blank and not 0.

    Is it possible to come up with a formula that does not put a 0 in the Parent Task if all the Child Tasks are blank?

    Many thanks.


    Nigel

  • David Joyeuse
    David Joyeuse ✭✭✭✭✭

    @Nigel Michell

    Which formula do you have in the children rows? The cell being empty, does not necessarily mean that the cell is blank.

    Until then, let's try this:

    =如果条件统计(孩子(),ISNUMBER(@cell))<>0, SUMIF(CHILDREN(), ISNUMBER(@cell)), "")

    This will check for if you have numbers or not in children cell. If that count is equal to zero, you'll display nothing. Otherwise, you'll sum Children that are numbers only so you don't get any errors.

  • @David Joyeuse

    There is no formula in the Child rows - the value is manually entered based on the predicted time remaining for the Task.

    Maybe I am expecting too much. Your new formula works if all the Child cells are empty but if one is 0 then the Parent Task is recorded as 0 and the Status of the Task is updated to complete. This is the formula that I am using for this field:

    =IF([% Comp]@row = 1, "Complete", IF(AND([Time Spent (Hours)]@row > 0, [% Comp]@row = 0), "In Progress", IF(AND([% Comp]@row <= 0.9999, [% Comp]@row >= 0.0001), "In Progress", "Not Started")))

    Thanks for your continued suggestions.

    image.png


  • @David JoyeuseI suppose the obvious way to fix the problem is to manually copy the value from the 'Effort' column to the 'Remaining Effort' column so that the child cells are not null but I wanted to see if there was a formula that could be used to prevent this.

  • David Joyeuse
    David Joyeuse ✭✭✭✭✭

    @Nigel Michell

    OK, we should work with your status column then.

    =SUMIFS(CHILDREN(),CHILDREN([Status of the Task Column]), <>"Not Started")

  • @David Joyeuse

    I also need the other Statuses of 'In Progress' and 'Complete'?

  • David Joyeuse
    David Joyeuse ✭✭✭✭✭

    Not really, as it should be designated to work only when things are not started according to what you previously said.

    But as a whole, I believe it would be better to automate the whole thing so you don't have to enter data manually somewhere in the process, except maybe in the [Time Spent (Hours)] column (though we could use some formulas to gather this from other sheets as people works on stuff).

    Could you provide us a screenshot of the whole sheet, with no sensitive data or confidential ones within it?

  • @David Joyeuse

    I have attached a Word document that outlines all the columns in our Template and any formulae that may be applied.

    Please let me know if you need anything else?


  • David Joyeuse
    David Joyeuse ✭✭✭✭✭

    @Nigel Michell

    Your doc back with a few comments in red that will help I hope :)

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out theFormula Handbook template!
Hi, <\/p>

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-27T02:16:35+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":26,"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-27T02:16:35+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":25,"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":"

\n \n https:\/\/community.smartsheet.com\/discussion\/109474\/help-with-date-calculation-formula\n <\/a>\n<\/div>\n

Hi, <\/p>

I hope you're well and safe!<\/p>

Try something like this.<\/p>

=IF([Date Reported]@row <> \"//www.santa-greenland.com/community/discussion/70787/\", IF([Resolution Date]@row = \"//www.santa-greenland.com/community/discussion/70787/\", NETDAYS([Date Reported]@row, TODAY()), NETDAYS([Date Reported]@row, [Resolution Date]@row)))<\/p>

Did that work\/help? <\/p>

I hope that helps!<\/p>

Be safe, and have a fantastic weekend!<\/p>

Best,<\/p>

Andrée Starå<\/strong><\/a> | Workflow Consultant \/ CEO @ WORK BOLD<\/strong><\/a><\/p>

Did my post(s) help or answer your question or solve your problem? Please support the Community by <\/em>marking it Insightful\/Vote Up, Awesome, or\/and as the accepted answer<\/em><\/strong>. It will make it easier for others to find a solution or help to answer!<\/em><\/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