Find the Latest Date for a Selected Item in Excel
Question details
Find the most recent date associated with an item selected from a list.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains item names and dates, and a separate cell holds the selected item.
- Observed behavior
- The desired result is the latest date from the rows that match the selected item.
Check that item names are in C4:C23, dates are in D4:D23, and the selected item is in G6, or adjust the formulas to match your worksheet. Make sure the dates are stored as Excel dates rather than text.
Use MAXIFS to Return the Latest Matching Date
Use MAXIFS when your version of Excel supports it to find the maximum date for the selected item.
Choose or enter the item name in cell G6.
Click an empty result cell, enter =MAXIFS($D$4:$D$23,$C$4:$C$23,$G$6), and press Enter.
Select the result cell and choose Home > Number Format > Short Date or Long Date.

Use a LARGE and IF Array Formula in Older Excel Versions
Use this alternative when MAXIFS is unavailable.
Find the Latest Matching Date in WPS Spreadsheets
Use MAXIFS in WPS Spreadsheets to return the latest date associated with a selected item, then format the result as a date.
- 1. Open the workbook: Open WPS Spreadsheets and use Open to select your Excel workbook.
- 2. Choose an item: Enter or select the item in G6, with item names in C4:C23 and dates in D4:D23.
- 3. Calculate the latest date: Click an empty cell, enter =MAXIFS($D$4:$D$23,$C$4:$C$23,$G$6), and press Enter.
- 4. Format and save: Select the result cell, choose a date format from the Home tab, and use File > Save to save the workbook.

Frequently Asked Questions
Why does the result appear as a number instead of a date?
Excel stores dates as serial numbers. Select the result cell and choose Home > Number Format > Short Date or Long Date.
What happens if the selected item is not in the list?
MAXIFS returns 0 when no rows match. To display a blank instead, use =IF(COUNTIF($C$4:$C$23,$G$6)=0,"",MAXIFS($D$4:$D$23,$C$4:$C$23,$G$6)).
Why does the LARGE and IF formula return #NUM!?
The formula may not have found a numeric date for the selected item. Check that G6 matches an item in C4:C23 and that the corresponding cells in D4:D23 contain real dates.
How do I adapt the formula to a different worksheet layout?
In the MAXIFS formula, replace D4:D23 with your date range, C4:C23 with the corresponding item range, and G6 with the selected-item cell. Keep the date and item ranges the same size.




