Average only parent rows
I have 4 parent rows and each row has 3 child rows. I want to take an average of only parent row percentage.
Best Answer
-
You can identify the parent rows by counting the number of children. Any row with more than 0 children is a parent. If you add a helper column to the sheet you can use this formula to put a 1 against all the parent rows and a 0 against the children. You can then hide that column.
=IF(COUNT(CHILDREN()) > 0, 1, 0)
Then instead of the AVG function you can use AVERAGEIF to average only the rows that have a 1 in the parent column.
=AVERAGEIF(Parent:Parent, 1, [% col]:[% col])
Answers
-
You can identify the parent rows by counting the number of children. Any row with more than 0 children is a parent. If you add a helper column to the sheet you can use this formula to put a 1 against all the parent rows and a 0 against the children. You can then hide that column.
=IF(COUNT(CHILDREN()) > 0, 1, 0)
Then instead of the AVG function you can use AVERAGEIF to average only the rows that have a 1 in the parent column.
=AVERAGEIF(Parent:Parent, 1, [% col]:[% col])
-
That works. Thanks...
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63K Get Help
- 379 Global Discussions
- 212 Industry Talk
- 442 Announcements
- 4.6K Ideas & Feature Requests
- 140 Brandfolder
- 129 Just for fun
- 130 Community Job Board
- 449 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 305 Events
- 34 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!