How to Return the Maximum Matching Date Using MAXIFS in Excel
Question details
The user needs to retrieve the most recent (maximum) start date for a specific workflow step across multiple rows with the same ID, bypassing the limitation of INDEX/MATCH which only returns the first match.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Working with a dataset containing multiple process rows per ID and needing to extract the absolute latest date for a specific workflow stage.
- Observed behavior
- Using INDEX/MATCH only returns the first matching date found in the dataset, whereas the goal state is to return the absolute latest date matching multiple specific criteria.
Ensure your date column contains valid date values rather than text strings, and verify that your spreadsheet software version supports the MAXIFS function.
Use the MAXIFS Function to Find the Latest Date
The MAXIFS function allows you to return the maximum value from a range based on one or more criteria, making it ideal for finding the latest date for a specific ID and workflow step.
MAXIFS evaluates multiple conditions (like matching an ID and a specific workflow step) and returns the highest numeric value from the specified range. Because spreadsheet software stores dates as sequential serial numbers, the highest number logically corresponds to the most recent date.
Click on the cell where you want the latest matching date to appear.
Type the formula: =MAXIFS([STAGE_START_DATE], [ID], [@ID], [WORKFLOW_STEP], "Step 1"). If you are not using an Excel Table format, adjust this to use standard cell ranges (e.g., =MAXIFS(C2:C100, A2:A100, A2, B2:B100, "Step 1")).
Press Enter to execute the function. The cell may initially display a 5-digit number.
Right-click the result cell, select 'Format Cells', navigate to the Number tab, select 'Date', and choose your preferred date format. Click OK.

Use an Array Formula (MAX and IF) for Older Excel Versions
If you are using an older version of Excel that does not support MAXIFS, you can combine the MAX and IF functions in an array formula to achieve the exact same result.
Analyze Data and Use Advanced Functions Easily in WPS Spreadsheet
WPS Spreadsheet fully supports the MAXIFS function along with hundreds of other advanced formulas. It provides a highly compatible and smooth data analysis experience for processing complex datasets without lag.
- 1. Download WPS Office: Download and install WPS Office for free from the official website.
- 2. Open Your Dataset: Launch WPS Spreadsheet and open your existing data file.
- 3. Apply MAXIFS: Select the target cell and use the exact same MAXIFS formula as you would in Excel.
- 4. Format to Date: Use the Format Cells menu to apply the proper Date formatting to your formula results.

Frequently Asked Questions
Why does my MAXIFS result look like a random 5-digit number?
Spreadsheets store dates as sequential serial numbers (for example, 44562 represents a specific date in 2022). If you see a number like this, your formula is working correctly. You simply need to right-click the cell, select 'Format Cells', and apply a Date format.
Why is my MAXIFS formula returning a 0?
A result of 0 usually means no rows in your dataset meet all the specified criteria. Check for typos in your formula criteria, ensure your ranges are exactly the same size, and verify there are no hidden spaces in your data.
Can I use MAXIFS with more than two criteria?
Yes, the MAXIFS function can handle up to 126 pairs of criteria ranges and criteria. You just need to append the additional range and condition to the end of your formula.
Why doesn't INDEX/MATCH work for finding the latest date?
By default, INDEX/MATCH searches from top to bottom and stops at the very first match it finds. If there are multiple entries for the same ID, it will not check the rest to find a later date. MAXIFS is specifically designed to evaluate all matches and return the highest value.




