#### 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, please Visit the Current Forums.

# Counting Children

edited 12/09/19

What formula do I use to get a count of sub tasks under a particular task Parent/Child?

• Please try =COUNT(CHILDREN(...)). For more details, see: http://help.smartsheet.com/customer/portal/articles/775363#hierarchy

• That did the trick!  Thank you so much!

• ✭✭✭✭✭✭

Now,

How do you count the "sub-children" or "grand children"??

For example, I have a main task, with three sub tasks, each of which has 12 sub tasks.  So, in total, I have 3 children and 36 "sub-child" tasks.  How do I count these?

Do I have to do a sum of the children of three tasks ??   (i could figure that one out, but would prefer something more elegant.

• Employee

Brad, do you want the result to be 36?

Add =COUNT(CHILDREN() to the three children and =SUM(CHILDREN() to the main parent.

• ✭✭✭✭✭✭

Thanks Travis.

That is effectively what I had to do.  I used this, and just saved the =SUM(CHILDREN())

=COUNT(CHILDREN(Room245)) + COUNT(CHILDREN(Room276)) + COUNT(CHILDREN(Room285))

This gave me 36.

But the answer, in the end, is that grand-children counting is not supported in a formula or function yet.

• ✭✭✭✭✭✭
edited 03/22/16

Column 1: [Value]

Formula:

=SUM(CHILDREN())

If user enters a value (for the grand-children for example) the formula is a gone and that's OK unless this later becomes a parent. Lock the row if you can.

Column 2: [Sum]

Formula:

=IF(COUNT(CHILDREN(Value23)) > 0, SUM(CHILDREN(Value23)))

for Row 23.

This will sum all children and grand children (and great-grand children too)

Cell will be blank for non-parents.

Craig

This discussion has been closed.