How can I return the latest value based on a matching ID?

marktuan

New member
Hi everyone,
I have a table with multiple entries for the same ID and different dates. I would like to return the most recent value associated with a specific ID.
For example:
IDDateValue
A0101-Jan-2026100
A0115-Jan-2026120
A0120-Feb-2026150
B0105-Jan-202680
sports games
If I look up A01, I want Excel to return 150 (the value from the latest date).
What formula would be the best approach for this in Excel 365? Thanks in advance for any help!
 
Hello Marktuan,

In Excel 365, a simple and efficient way is to combine XLOOKUP with MAXIFS.

Assuming your data is in A2 (ID, Date, Value) and the lookup ID is in E2, use:
=XLOOKUP(MAXIFS(B:B,A:A,E2),B:B,C:C)

Or, to make sure it returns the latest value for the specific ID only:
=XLOOKUP(
MAXIFS(B:B,A:A,E2),
FILTER(B:B,A:A=E2),
FILTER(C:C,A:A=E2)
)


For ID A01, MAXIFS finds the latest date (20-Feb-2026), and XLOOKUP returns the corresponding value (150).

If your data is stored in an Excel Table, the formula can be written with structured references, which makes it easier to maintain as new records are added.

Hope this helps!
 
Hi everyone,
I have a table with multiple entries for the same ID and different dates. I would like to return the most recent value associated with a specific FNF ID.
For example:
IDDateValue
A0101-Jan-2026100
A0115-Jan-2026120
A0120-Feb-2026150
B0105-Jan-202680
sports games
If I look up A01, I want Excel to return 150 (the value from the latest date).
What formula would be the best approach for this in Excel 365? Thanks in advance for any help!
If you're using Excel 365, you can do it with a single formula using `XLOOKUP` and `MAXIFS`:
Code:
=XLOOKUP(MAXIFS(B:B,A:A,E2),FILTER(B:B,A:A=E2),FILTER(C:C,A:A=E2))
Where:
Column A = ID
Column B = Date
Column C = Value
E2 = the ID you're searching for (e.g., A01)
`MAXIFS` finds the latest date for the selected ID, and XLOOKUP returns the corresponding value.
If your data is in an Excel Table, it's even cleaner with structured references.
 

Online statistics

Members online
0
Guests online
253
Total visitors
253

Forum statistics

Threads
459
Messages
2,046
Members
2,365
Latest member
eliradelorca
Back
Top