Excel Formula to Return the Most Recent Entry by Date
Question details
Find the most recent date in a column and return the corresponding tracking value or row.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet stores dates in column A and medical or tracking values in columns P through U.
- Observed behavior
- The desired result is the value or data row associated with the latest date, even if the records are not sorted.
Make sure column A contains at least one valid Excel date rather than dates stored as text. Adjust the row ranges in the formulas to match your data, and keep the date and return ranges aligned.
Return the First Matching Row with XLOOKUP
Use this method in Microsoft 365 to return columns P through U for the first row with the latest date.
Click an empty cell with enough blank space to its right for six returned columns.
In the selected cell, enter =XLOOKUP(MAX(A2:A5000),A2:A5000,P2:U5000) and press Enter.

Return Every Row with the Latest Date Using FILTER
Use FILTER in Microsoft 365 when multiple records may share the most recent date.
Return a Value with INDEX and MATCH
Use this approach to return a value from column P without XLOOKUP or FILTER.
Return the Latest Entry in WPS Spreadsheet
Use MAX, MATCH, and INDEX in WPS Spreadsheet to find the latest date and return values from the matching row.
- 1. Open the workbook: Open WPS Spreadsheet and select Open to choose your workbook.
- 2. Check the dates: Review column A and make sure its entries are valid spreadsheet dates.
- 3. Enter the formula: Select an empty cell and enter =INDEX(P$2:P$5000,MATCH(MAX($A$2:$A$5000),$A$2:$A$5000,0)), then press Enter.
- 4. Copy across: Drag the formula cell's fill handle to the right to return values from additional columns.

Frequently Asked Questions
Does XLOOKUP return all rows with the latest date?
No. XLOOKUP returns the first match by default. To return all matching rows from columns P through U, use =FILTER(P2:U5000,A2:A5000=MAX(A2:A5000)).
What if my dates are stored as text?
Convert them to real Excel dates before using MAX. For example, select column A and use Data > Text to Columns, choosing an appropriate date format in the final step.
How do I return just one value instead of the whole row?
Use =INDEX(P2:P5000,MATCH(MAX(A2:A5000),A2:A5000,0)) to return the column P value from the first row with the latest date.
Why does my FILTER formula show a spill error?
The output area may contain data. Clear the cells below and to the right of the formula so Excel can display all matching rows.




