Return the last value
Hi there
I need a formula that finds the value of the 'join' column and returns the value of the 'total' column but return the last value according to the date.
Best Answer
-
Hey @Diego ELvira
Sorry I misunderstood. So you want the max date per the the JOIN. To do this, you will need a helper column to first find the various Max dates. You will use this to then find Total per Join.
IsMax checkbox Helper column
=IF(Date@row = MAX(COLLECT(Date:Date, Date:Date, ISDATE(@cell), JOIN:JOIN, <>"", JOIN:JOIN, JOIN@row))), 1)
The formula you requested then becomes
=INDEX(COLLECT(TOTAL:TOTAL, JOIN:JOIN, JOIN@row, IsMax:IsMax, 1), 1)
Will this work for you?
Kelly
Answers
-
Hey @Diego ELvira
If I understand, you're looking for a formula that returns the TOTAL of the last date. This is the syntax if your formula is on the same sheet
=INDEX(TOTAL:TOTAL,MATCH(MAX(DATE:DATE), DATE:DATE, 0))
Will this work for you?
Kelly
-
@Kelly Moore What happens is that: I have a database with different IDs, so the 'join' column can contain, for example 20455-20-6-2, etc. What I need is to look for the cell of the 'join' column and return the last data according to the last date.
I had tried combining vlookup with other formulas but I haven't solved it.
-
Hey @Diego ELvira
Sorry I misunderstood. So you want the max date per the the JOIN. To do this, you will need a helper column to first find the various Max dates. You will use this to then find Total per Join.
IsMax checkbox Helper column
=IF(Date@row = MAX(COLLECT(Date:Date, Date:Date, ISDATE(@cell), JOIN:JOIN, <>"", JOIN:JOIN, JOIN@row))), 1)
The formula you requested then becomes
=INDEX(COLLECT(TOTAL:TOTAL, JOIN:JOIN, JOIN@row, IsMax:IsMax, 1), 1)
Will this work for you?
Kelly
-
It works, thank you @Kelly Moore 😉
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.8K Get Help
- 376 Global Discussions
- 207 Industry Talk
- 440 Announcements
- 4.5K Ideas & Feature Requests
- 139 Brandfolder
- 129 Just for fun
- 130 Community Job Board
- 449 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 284 Events
- 33 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!