Welcome to the Smartsheet Forum Archives


The posts in this forum are no longer monitored for accuracy and their content may no longer be current. If there's a discussion here that interests you and you'd like to find (or create) a more current version, pleaseVisit the Current Forums.

Counting all siblings below a master Parent

Ozgur Kalan
edited 12/09/19 inArchived 2015 Posts

Hi,

One of my sheets has a master Parent and have several parents and childs below.

What could be the formula to count all items below any Parent, which counts all parents and childs below?

Thanks in advance.

Tags:

Comments

  • Jill
    Jill
    edited 10/31/15

    This would be helpful to me as well.

  • Travis
    Travis Employee

    This can be done with a combination of two functions:

    COUNT(CHILDREN())

    and

    SUM(CHILDREND())

    -Create a new Text/Number column where you will add the formulas and display the count.

    -On each parent row (excluding the master parent) add this formula:

    =COUNT(CHILDREN(*CellReference*))

    Replace *CellReference* with the cell reference of the corresponding primary column parent row cell.

    -On your master parent row AND and parent rows that have parent rows under it, add the following formula:

    =COUNT(CHILDREN(*CellReference*)) + SUM(CHILDREN())

    Replace *CellReference* with the cell reference of the corresponding primary column parent row cell.

    Now, what this will do: each parent row will count the number of children it has. The the master parent will sum these value and count the number of children it has (which are the parents).

    I made a quick sheet to show you how this works. Formulas are located in the Count column.

    https://app.smartsheet.com/b/publish?EQBCT=ff2575da987340aca8a7a87269987217

    Let me know if you have any questions about how this works!

  • Brett Evans
    Brett Evans ✭✭✭✭✭✭

    Look at John's formulas and thought processes in this post. They may be helpful.

    https://community.smartsheet.com/discussion/check-if-child-row

  • Ozgur Kalan
    edited 11/02/15

    Awesome! Working like a charm:

    =COUNT(CHILDREN(Task1)) + SUM(CHILDREN())

    I have pasted all cells the same formula and all items below are counted.

    (Except the parent itself, otherwise there pops up another problem, at least I know that counted siblings+1 is the total number of items)

    Thanks.

  • Good evening:

    I am trying to do the same except combine the Grand Parent Row name and Count of all grandchildren in the same row but unsuccessful. My formula below:

    Current Formula: =Total (" + COUNT(CHILDREN()) + ") + SUM(CHILDREN())"

This discussion has been closed.
If you want to know the percentage over\/under the Contract Amount<\/strong>, your formula (placed the [Percentage] column) would be:<\/p>

=([Contract amount]@row - [Install Labor (actual)]@row) \/ [Contract amount]@row<\/p>

Be sure the \"Percentage\" column is formatted as a percentage. Positive numbers show that your total spend is under<\/strong> the [Contract amount]. Negative values show your total spend is over<\/strong>.<\/p>

You can use a similar formula to measure how far over\/under your [Labor $ (quoted)] amount is from your [Install Labor (actual)] amount.<\/p>

=([Labor $ (quoted)]@row - [Install Labor (actual)]@row) \/ [Labor $ (quoted)]@row<\/p>

Here, though, a negative value shows that you are OVER<\/strong> the estimate. A positive value shows you are at or UNDER<\/strong> the estimate.<\/p>

\n
\n \n \"Screenshot<\/img><\/a>\n <\/div>\n<\/div>\n


<\/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":107038,"type":"question","name":"Modified Date loses detail when referenced","excerpt":"Application: Trying to capture and display a 'sheet last modified' value on a dashboard. Approach: Using a formula in the sheet summary sidebar to find the max value of all timestamps in the 'Modified' column. Formula is as follows and is functioning as expected. =MAX([Modified]:[Modified]) Problem: The displayed value…","snippet":"Application: Trying to capture and display a 'sheet last modified' value on a dashboard. Approach: Using a formula in the sheet summary sidebar to find the max value of all…","categoryID":322,"dateInserted":"2023-06-28T17:43:23+00:00","dateUpdated":null,"dateLastComment":"2023-06-28T21:44:02+00:00","insertUserID":154049,"insertUser":{"userID":154049,"name":"Rob W.","url":"https:\/\/community.smartsheet.com\/profile\/Rob%20W.","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-28T21:44:18+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":154049,"lastUser":{"userID":154049,"name":"Rob W.","url":"https:\/\/community.smartsheet.com\/profile\/Rob%20W.","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-28T21:44:18+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":25,"score":null,"hot":3375964045,"url":"https:\/\/community.smartsheet.com\/discussion\/107038\/modified-date-loses-detail-when-referenced","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/107038\/modified-date-loses-detail-when-referenced","format":"Rich","lastPost":{"discussionID":107038,"commentID":382970,"name":"Re: Modified Date loses detail when referenced","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/382970#Comment_382970","dateInserted":"2023-06-28T21:44:02+00:00","insertUserID":154049,"insertUser":{"userID":154049,"name":"Rob W.","url":"https:\/\/community.smartsheet.com\/profile\/Rob%20W.","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-28T21:44:18+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-28T21:29:15+00:00","dateAnswered":"2023-06-28T18:46:15+00:00","acceptedAnswers":[{"commentID":382932,"body":"

Set the Sheet Summary field as text\/number then add +\"//www.santa-greenland.com/community/discussion/3440/\" to the end of the MAX function (plus quote quote) to convert it into a text string.<\/p>

=MAX([Modified]:[Modified]) + \"//www.santa-greenland.com/community/discussion/3440/\"<\/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":107037,"type":"question","name":"date range formula","excerpt":"Hi dear community, I need a formula to return the values \"Process\" and \"At Risk\" when a certain date is reached. I have a \"Start date\" column. I need to notify the assignee of the status for each task (all in separate columns). When we are 145-91 days from the start date, it should return \"Process\". When we are 90-0 days…","snippet":"Hi dear community, I need a formula to return the values \"Process\" and \"At Risk\" when a certain date is reached. I have a \"Start date\" column. I need to notify the assignee of the…","categoryID":322,"dateInserted":"2023-06-28T17:30:38+00:00","dateUpdated":"2023-06-28T17:36:27+00:00","dateLastComment":"2023-06-28T21:09:58+00:00","insertUserID":162910,"insertUser":{"userID":162910,"name":"Haleh","url":"https:\/\/community.smartsheet.com\/profile\/Haleh","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-28T21:03:14+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":91566,"lastUserID":162910,"lastUser":{"userID":162910,"name":"Haleh","url":"https:\/\/community.smartsheet.com\/profile\/Haleh","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-28T21:03:14+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":21,"score":null,"hot":3375961236,"url":"https:\/\/community.smartsheet.com\/discussion\/107037\/date-range-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/107037\/date-range-formula","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":107037,"commentID":382966,"name":"Re: date range formula","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/382966#Comment_382966","dateInserted":"2023-06-28T21:09:58+00:00","insertUserID":162910,"insertUser":{"userID":162910,"name":"Haleh","url":"https:\/\/community.smartsheet.com\/profile\/Haleh","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-28T21:03:14+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-29T10:21:48+00:00","dateAnswered":"2023-06-28T18:44:53+00:00","acceptedAnswers":[{"commentID":382931,"body":"

Try this:<\/p>

=IF([Start Date]@row>= TODAY(-90), \"At Risk\", IF([Start Date]@row>= TODAY(-145), \"Process\"))<\/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&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&siteSectionID=0&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 Posts","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

Trending Posts