Function Problems

Find the Latest Date for a Selected Item in Excel

Tauseeq MagsiTauseeq Magsi Dec 2, 2026 868 views

Question details

Find the most recent date associated with an item selected from a list.

Find the Latest Date for a Selected Item in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the item

Choose or enter the item name in cell G6.

2
Enter the formula

Click an empty result cell, enter =MAXIFS($D$4:$D$23,$C$4:$C$23,$G$6), and press Enter.

3
Format the result as a date

Select the result cell and choose Home > Number Format > Short Date or Long Date.

Use MAXIFS to Return the Latest Matching Date
When there is no matching item: MAXIFS returns 0 when no rows match. To show a blank instead, use =IF(COUNTIF($C$4:$C$23,$G$6)=0,"",MAXIFS($D$4:$D$23,$C$4:$C$23,$G$6)).
WPS Spreadsheets

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. 1. Open the workbook: Open WPS Spreadsheets and use Open to select your Excel workbook.
  2. 2. Choose an item: Enter or select the item in G6, with item names in C4:C23 and dates in D4:D23.
  3. 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. 4. Format and save: Select the result cell, choose a date format from the Home tab, and use File > Save to save the workbook.
Find the latest date for an item with a single formulaOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and formatting controlsWork with spreadsheets in a free Office suite
microsoft office alternative - wps office

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.