COUNTIF Parent but not Children
I added active to my child rows to get the children to appear on a report so now I need to change my formula to exclude children from a count because of over-counting. I have seen articles about helper columns and added a checkbox helper but I haven't had any success. Some answers have shown an IF statement, but where do I type that statement?
Best Answer
-
I use a helper column that tells you if a row is a parent or child. Using this formula,
=COUNT(ANCESTORS([Column Name]@row)) ,
the helper column would have a value of 0 for SRS (parent) while Read Only, Planning, etc. (child rows) would have 1. Of course, you would then change to COUNTIFS to account for the additional variable.
Will this work?
Answers
-
I use a helper column that tells you if a row is a parent or child. Using this formula,
=COUNT(ANCESTORS([Column Name]@row)) ,
the helper column would have a value of 0 for SRS (parent) while Read Only, Planning, etc. (child rows) would have 1. Of course, you would then change to COUNTIFS to account for the additional variable.
Will this work?
-
That worked. Thanks for the help.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.6K Get Help
- 433 Global Discussions
- 136 Industry Talk
- 465 Announcements
- 4.9K Ideas & Feature Requests
- 143 Brandfolder
- 147 Just for fun
- 63 Community Job Board
- 466 Show & Tell
- 32 Member Spotlight
- 2 SmartStories
- 298 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!