Skip to main content
 

How to find the earliest or latest date base on criteria in Excel?

Author: Xiaoyang Last Modified: 2024-08-09

Let’s say, you have two columns of data which Column A contains the products, Column B includes date, and now, you want to find the earliest or latest date based on the criteria in Column A as following screenshot shown. How could you solve this problem quickly in Excel?

a screenshot showing the original data and the earliest and latest dates of a product

Find the earliest / latest date based on criteria with formulas

Find the earliest / latest date based on criteria with Kutools for Excel


Find the earliest / latest date based on criteria with formulas

In Excel, the following array formulas may help you to return the oldest or latest date with criteria, please do as follows:

To get the earliest date based on criteria:

1. Enter this formula: =MIN(IF($A$2:$A$16="Office Tab",$B$2:$B$16)) into a blank cell where you want to get the result, and then press Ctrl + Shift + Enter keys together to return the oldest date based on the criteria – Office Tab of Column A, and you will get a 5 digits number, See screenshot:

Tips: In this formula: A2:A16 is the data range contains the criteria that you based on, “Office Tab” is the criteria that you use, and B2:B16 includes the date that you want to return.

a screenshot of using the formula

2. Then you should convert the 5 digits number to date format, please click Home, go to General drop down to choose the Short Date format , and the earliest date based on Office Tab has been displayed, see screenshot:

a screenshot of changing the cell to Short Date formatting

Note:

To get the latest date with the criteria, you can apply this array formula: =MAX(IF($A$2:$A$16="Office Tab",$B$2:$B$16)), and remember to press Ctrl + Shift + Enter keys together to get the correct result.


Find the earliest / latest date based on criteria with Kutools for Excel

Kutools for Excel’s Advanced Combine Rows feature can help you to get the earliest or latest date of each item in Column A without any formulas.

If you have installed Kutools for Excel, please do as follows:

1. If you want to keep the original data, you can copy and paste the data to another range, and then select the pasted range that you want to use.

2. Then click Kutools > Merge & Split > Advanced Combine Rows

3. In the Combine Rows Based on Column dialog box, please click the column name that you want to get the date based on, and then click Primary Key option, see screenshot:

a screenshot of setting a key column in the dialog box

4. Then click the date column that you want to return the latest or earliest date, and select Calculate > Max / Min, ( select Max to get the latest date and Min to return the oldest date), see screenshot:

a screenshot of setting a calculation type

Tips: If you check My data has headers, your header within the data range will be ignored automatically, to get the correct date format, please uncheck Use formatted values option.

5. Then click Ok button, the latest or oldest date base on each item has been returned as follows:

a screenshot of the original data a screenshot of an arrow a screenshot of the final data

Click to Download and free trial Kutools for Excel Now!


Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!