How to Find the Latest Date for Multiple Criteria in Spreadsheet
Question details
The user needs a formula to return the most recent date a specific manager traveled with a specific sales representative from a data grid.

- Product
- Spreadsheet
- Device & OS
- not provided
- Scenario
- Extracting the maximum date value based on two separate text conditions (manager name and sales representative name) stored in a table.
- Observed behavior
- Requires evaluating multiple criteria combinations against a date range to return the single maximum date that meets all given conditions.
Ensure your dates are formatted as actual date values (numbers) rather than text, and verify that the criteria names exactly match the spelling in your data ranges.
Use the MAXIFS Function to Find the Latest Date
MAXIFS is the most straightforward and efficient way to return the maximum value from a range based on one or multiple criteria.
The MAXIFS function evaluates a specified range and returns the largest value (the latest date) that meets all the criteria you define. This is ideal when you need to match both a manager's name and a sales representative's name.
Ensure your data is organized into columns. For example, Dates in Column A (A2:A100), Managers in Column B (B2:B100), and Sales Representatives in Column C (C2:C100).
Select an empty cell and enter the formula: =MAXIFS(A2:A100, B2:B100, "ManagerName", C2:C100, "RepName"). You can replace the text strings with cell references (like E2 and F2) to make the formula dynamic.
Press Enter. If the result appears as a large 5-digit number, right-click the cell, choose 'Format Cells', and apply a Date format to view the correct calendar date.

Use a MAX and IF Array Formula
If you are using an older version of spreadsheet software that does not support MAXIFS, an array formula combining MAX and IF achieves the exact same result.
Find Data Quickly with WPS Spreadsheet
WPS Spreadsheet provides robust data analysis tools, including native support for advanced functions like MAXIFS, making it incredibly easy to extract specific dates based on multiple criteria.
- 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your calendar or sales data grid.
- 2. Use the Function Wizard: Navigate to the Formulas tab and click 'Insert Function' to easily find and insert the MAXIFS function.
- 3. Select criteria dynamically: Follow the on-screen prompts in the function dialog box to select your date ranges and criteria cells without typing complex syntax.

Frequently Asked Questions
Why does my MAXIFS formula return a 0?
A result of 0 usually means that no records in your data matched all the specified criteria. It can also happen if your calendar dates are accidentally stored as text instead of valid numeric date formats. Try reformatting your date column.
Can I reference cells for the criteria instead of typing names into the formula?
Yes, it is highly recommended to use cell references. Instead of typing "ManagerName" in the formula, you can click on a cell (e.g., G2) that contains the manager's name. This allows you to quickly change the search criteria without editing the formula itself.
How do I find the earliest date instead of the latest?
To find the earliest date, simply replace the MAXIFS function with the MINIFS function. The syntax and criteria ranges remain exactly the same: =MINIFS(DateRange, ManagerRange, "ManagerName", RepRange, "RepName").
Does MAXIFS work if my data is arranged in a 2D calendar grid instead of columns?
MAXIFS requires ranges to be symmetrical, typically 1D columns or rows. If your names and dates are scattered across a complex 2D calendar grid, you may need to restructure your data into flat columns (Date, Manager, Rep) first, or use a more complex array formula using INDEX and MATCH.




