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
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 140 Industry Talk
- 472 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!