Count specific total number grand children rows and ignore higher rows

Hello All,
I am tracking different sessions being hosted between employees.
The sessions are the rows with the white background. I want to dynamically count the total number of sessions that are happening for row 2 "IMC".
So I need to count the number of children of row 3 "IMC Common Architecture" as well as the number of children ofΒ row 6 "IMC CAD" to come up with a total.
Right now just to make it work,Β I am using:
=COUNT(CHILDREN([Task Name]3), +COUNT(CHILDREN([Task Name]6)))
Which is somehow returning the number 3, rather than 11.
However, more light gray parent rows, like "IMC RMS" may be added a later date, so I would like to count the sessions under these dynamically and not have to edit my formula in the future.
I can't just count the children of row 2 IMC because then it would include the topic rows like "IMC Common Architecture".
Is this possible?
Β
Comments
-
Try using a helper column withΒ
Β
=COUNT(ANCESTORS())
Β
This will give you a 0 for parent rows, 1 for child rows, 2 for grandchildren rows, etc.
Β
You can then useΒ
Β
=COUNTIFS([Helper Column]:[Helper Column], 2)
Β
That will count how many rows have 2 ancestors aka grandchildren rows.
-
Thank you for taking the time to reply Paul, this worked for me!
-
tlawrence and Paul,
I almost always add + 1 in the end because then it will be the same number as in Card View.
Best,
AndrΓ©e
SMARTSHEET EXPERT CONSULTANT & PARTNER
AndrΓ©e StarΓ₯ | Workflow Consultant / CEO @ WORK BOLD
W: www.workbold.com | E: andree@workbold.com | P: +46 (0) - 72 - 510 99 35
Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.
-
Good thinking. I have never really had a use for Card View, so I never think about it.
-
Andree,
Thank you for the suggestion! Could you be a little more specific about what this should look like?
Β
Do you mean simply: =COUNTIFS([Helper Column]:[Helper Column], 2) + 1
Wouldn't this throw the numbers off?
-
I was thinking about the hierarchyΒ levels so yes it would not work for the above.
Formula for level: =COUNT(ANCESTORS()) + 1)
Happy Holidays & Happy New Year!
Best,
AndrΓ©e StarΓ₯
Workflow Consultant @ Get Done Consulting
SMARTSHEET EXPERT CONSULTANT & PARTNER
AndrΓ©e StarΓ₯ | Workflow Consultant / CEO @ WORK BOLD
W: www.workbold.com | E: andree@workbold.com | P: +46 (0) - 72 - 510 99 35
Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.
Help Article Resources
Categories
Check out the Formula Handbook template!