Pulling Parent/Ancestor info depending on row hierarchy
I'm trying to have a column (Dept Helper) auto fill based on one Ancestor cell in another column (Department). I have a helper column (APC) keeping track of the hierarchy already (Ancestor = 0-Anc, Parent=1-Par, Child=2-Chi). I only want the Dept Helper to fill-in rows that are not the header row (Ancestor).
Here is the formula I have now, I can't figure out why it shouldn't work.
=IF(APC@row = "1-Par", PARENT(Department@row), IF(APC@row = "2-Chi", ANCESTORS(Department@row)))
It works for Parents but not Children, which returns "INVALID COLUMN VALUE"
I've tried using OR and NOT, I'm not entirely sure I used them properly, but they haven't worked either.
Any help is appreciated.
Thanks
Best Answer
-
Try this:
=IF(APC@row <> "0-Anc", INDEX(ANCESTORS(Department@row), 1))
Answers
-
Try this:
=IF(APC@row <> "0-Anc", INDEX(ANCESTORS(Department@row), 1))
-
Perfect, that did the trick. Thank you!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 67.2K Get Help
- 462 Global Discussions
- 156 Industry Talk
- 506 Announcements
- 5.4K Ideas & Feature Requests
- 85 Brandfolder
- 156 Just for fun
- 81 Community Job Board
- 517 Show & Tell
- 35 Member Spotlight
- 3 SmartStories
- 308 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!