Equation to sum children, if no children then return value from a different column
Hi - I"m looking for an equation in column A to sum the value of column B for any children rows. However, if there are no children, then I would like the equation to return the value in column B. I have a helper column set up so that parent/child can be distinguished with 0, 1 or 2 value based on hierarchy.
Any guidance much appreciated. Thanks,
Best Answer
-
Hi @Karenmst!
I would make another helper column for children due to a piece of criteria being if the row has no children. You can do this by using =COUNT(CHILDREN()).
Assuming that new helper column is named "Helper - Children", you can use the following equation for your problem:
=IF([Helper - Children]@row > 0, SUM(CHILDREN([column B]@row)), [column B]@row)
I might've misunderstood your question so let me know if that doesn't work!
Let's connect!
www.linkedin.com/in/ashleylknight
Answers
-
Hi @Karenmst!
I would make another helper column for children due to a piece of criteria being if the row has no children. You can do this by using =COUNT(CHILDREN()).
Assuming that new helper column is named "Helper - Children", you can use the following equation for your problem:
=IF([Helper - Children]@row > 0, SUM(CHILDREN([column B]@row)), [column B]@row)
I might've misunderstood your question so let me know if that doesn't work!
Let's connect!
www.linkedin.com/in/ashleylknight
-
That did the trick!! Thank you so much!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!