Find the Latest Date per ID and Return Its Status in Excel
Question details
Find the most recent date for each unique ID and return the status from the matching row.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A table contains multiple rows per ID, each with a date and status, and the user wants one latest status per ID.
- Observed behavior
- The desired result is a list of IDs with the status associated with each ID's latest date.
Check that dates are stored as actual spreadsheet dates rather than text. In the examples below, IDs are in A2:A6, dates in B2:B6, statuses in C2:C6, and unique IDs begin in E2; adjust the ranges to match your table.
Use MAXIFS and XLOOKUP to return the latest status
Use this method in Excel versions that support both MAXIFS and XLOOKUP.
Enter each unique ID in column E, starting in E2.
In F2, enter =IF(COUNTIF($A$2:$A$6,E2)=0,"",XLOOKUP(1,($A$2:$A$6=E2)*($B$2:$B$6=MAXIFS($B$2:$B$6,$A$2:$A$6,E2)),$C$2:$C$6,"")) and press Enter.
Drag the fill handle from F2 down alongside the IDs in column E.

Use an array formula in older Excel versions
Use INDEX, MATCH, and MAX when XLOOKUP or MAXIFS is unavailable.
Find the Latest Status for Each ID in WPS Spreadsheets
Use an array formula in WPS Spreadsheets to match each ID to its most recent date and return the corresponding status.
- 1. Open the spreadsheet: Open your Excel file in WPS Spreadsheets and check that IDs, dates, and statuses are in columns A, B, and C.
- 2. List unique IDs: Enter the IDs you want to look up in E2 and the cells below it.
- 3. Enter the formula: In F2, enter =IFERROR(INDEX($C$2:$C$6,MATCH(1,($A$2:$A$6=E2)*($B$2:$B$6=MAX(IF($A$2:$A$6=E2,$B$2:$B$6))),0)),"") and confirm it with Ctrl+Shift+Enter.
- 4. Fill down: Drag the fill handle from F2 down alongside the IDs, adjusting the source ranges if your table extends beyond row 6.

Frequently Asked Questions
What happens if an ID has two statuses on the latest date?
The formulas shown return the status from the first matching row in the source range. Reorder the rows or add a separate tie-breaker if you need a different result.
Why does the formula return a blank for an ID?
Check that the ID in column E matches an entry in column A and that the source ranges include all relevant rows. The formulas return a blank when no matching ID is found.
Why is the latest date calculation incorrect?
Check whether the values in column B are real spreadsheet dates rather than text. Convert text dates to dates before applying MAXIFS or the array formula.
Do I need Ctrl+Shift+Enter for every formula?
Use Ctrl+Shift+Enter for the older Excel array formula. The MAXIFS and XLOOKUP formula can be entered with Enter in supported Excel versions.




