Function Problems

Find the Latest Date per ID and Return Its Status in Excel

Camila MilosovichCamila Milosovich Dec 2, 2026 868 views

Question details

Find the most recent date for each unique ID and return the status from the matching row.

Find the Latest Date per ID and Return Its Status in Excel
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.
Before you start

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.

Solution 1Recommended

Use MAXIFS and XLOOKUP to return the latest status

Use this method in Excel versions that support both MAXIFS and XLOOKUP.

1
List the IDs

Enter each unique ID in column E, starting in E2.

2
Enter the lookup formula

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.

3
Fill down

Drag the fill handle from F2 down alongside the IDs in column E.

Use MAXIFS and XLOOKUP to return the latest status
Matching dates: If an ID has multiple rows with the same latest date, the formula returns the status from the first matching row. An ID that is not found returns a blank.
WPS Spreadsheets

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. 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. 2. List unique IDs: Enter the IDs you want to look up in E2 and the cells below it.
  3. 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. 4. Fill down: Drag the fill handle from F2 down alongside the IDs, adjusting the source ranges if your table extends beyond row 6.
Return a status from the row with the latest date for each IDOpen and edit Microsoft Excel XLSX filesFill the formula down for multiple IDsWork with a familiar spreadsheet interface
microsoft office alternative - wps office

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.