Retrieving Ancestor (date) value from multi-level parent-child rows
Hi All,
I used the following formula to retrieve ancestor (first parent) date value of the multi-level parent-child rows for each row.
=LEFT(INDEX(JOIN(ANCESTORS(Date@row), ","), 1), 8)
The issue that I'm facing is the return value being "TEXT" despite having "DATE" column type. Since I have to use this return value in comparing other dates, suggest any other alternative to retrieve the value in DATE format
Best Answer
-
Hi @Suriya
You can use the Header value as the search value of the MATCH function.
Find the relative position of the first ANCESTORs value of the Header in the Header:Header range gotten by INDEX(,1).
In English, the formula means to find the top ANCESTORS of a given header and use the relative position to get the corresponding date value.😀
=IF(COUNT(ANCESTORS(Header@row)) = 0, Date@row, INDEX(Date:Date, MATCH(INDEX(ANCESTORS(Header@row), 1), Header:Header, 0)))
Answers
-
Hi @Suriya
You can use the Header value as the search value of the MATCH function.
Find the relative position of the first ANCESTORs value of the Header in the Header:Header range gotten by INDEX(,1).
In English, the formula means to find the top ANCESTORS of a given header and use the relative position to get the corresponding date value.😀
=IF(COUNT(ANCESTORS(Header@row)) = 0, Date@row, INDEX(Date:Date, MATCH(INDEX(ANCESTORS(Header@row), 1), Header:Header, 0)))
-
It works! Thank you @jmyzk_cloudsmart_jp
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.1K Get Help
- 414 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 141 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!