How do you tell a cell what to do based on being a Parent or Children row?
I would like to use one formula in the entire column instead of having to copy and paste based on being a child or parent row. My child formula looks for word vacant in the name column and if so subtracts the total of 4 other cells from 0. If the word is not found the cell remains blank.
=IF(CONTAINS("vacant", Name@row), 0 - SUM([Career FTE - Active]@row:[Per Diem FTE - LOA]@row, ""))
The parent formula is just adding the children: =SUM(CHILDREN())
How do I put these together so that if it's a parent row it sums the children but if not it does the calculation? I'm confused on where to add the additional IF and CHILDREN in the formula. Any assistance is greatly appreciated!
Best Answer
-
You would use an IF statement like so:
=IF(COUNT(CHILDREN(Name@row)) > 0, parent_formula, child_formula)
Answers
-
You would use an IF statement like so:
=IF(COUNT(CHILDREN(Name@row)) > 0, parent_formula, child_formula)
-
Thank you Paul! This worked perfectly and I never would have figured out the right order for this. Happy Friday!
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.1K Get Help
- 412 Global Discussions
- 220 Industry Talk
- 459 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 140 Just for fun
- 57 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!