How to identify child and sub-childs of a parent so I can add conditional formatting?
Hello, I have several sub-childs and I am trying to add a column where I can for example say if a cell is Parent return parent, if child return child and if sub-child return sub-child?
I looked into several resources but there isn't any easy answer. If you can please help.
Answers
-
You can create a helper column to count the number of ANCESTORS of a cell.
0 ancestors = parent
1 ancestor = child
2 ancestors = sub-child, etc.
The formula is:
=COUNT(ANCESTORS(ColumnName@row))
Make it a column formula and it will apply to every row and every new row. Set your conditional formatting based on the value result from the formula.
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
-
Thanks Jeff! that partially worked. I had to use https://community.smartsheet.com/discussion/10461/using-hierarchy-formulas-conditional-formatting-to-color-code-rows-in-a-sheet. Appreciate your help.
-
Thank you, @Jeff Reisman. Your formula worked perfectly for me.
-
@alagator28 Glad to hear it!
So I have to ask: Are you an Alabama Gator? My wife went to Alabama, while I went to Florida (SEC Football Interfaith Marriage,) so our kids are definitely Ala-Gators! 🤣🐊
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
-
@Jeff Reisman no, I'm not an Alabama Gator, just a similarity with my name. But hey, Go Gators! 🤣
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!