Auto-assign # based on parent or child (sub-item)

I looking for a formula to auto-assign a number based on the parent/child level.
For example, first level parent would be auto-assigned zero (0). Any sub-items would then be 1, 2, 3, etc. based on what level the item is listed under the parent. I've provided an example of how this would look, but I've manually entered in the 0,1,2,3, etc. in the 'Level assignment" column. I'm looking for a formula to replace the numbers in that column so I don't have to manually enter them when new rows and children are added to parents.
Thank you!
Best Answer
-
I don't see your attachment but if you are looking for any parent row to be a 0, any sub task to be a 1, any sub-subtask to be a 2, and so on, this formula should work:
=Count(Ancestors())
Let me know if that helps or if you are looking for something different!
Answers
-
I don't see your attachment but if you are looking for any parent row to be a 0, any sub task to be a 1, any sub-subtask to be a 2, and so on, this formula should work:
=Count(Ancestors())
Let me know if that helps or if you are looking for something different!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 66.6K Get Help
- 434 Global Discussions
- 153 Industry Talk
- 495 Announcements
- 5.3K Ideas & Feature Requests
- 85 Brandfolder
- 155 Just for fun
- 77 Community Job Board
- 508 Show & Tell
- 34 Member Spotlight
- 2 SmartStories
- 308 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!