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

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?

Find the earliest / latest date based on criteria with formulas

#### 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.

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:

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.

 : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days.

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 > Content > Advanced Combine Rows, see screenshot:

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:

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:

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:

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

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days.

### 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 Toolsets:  12 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!
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
This doesnt work if there are null values in your array. Do you solve for that somewhere? e.g. in your example if one of the values for Office Tab is blank, null or otherwise zero, then formula =MIN(IF(\$A\$2:\$A\$16="Office Tab",\$B\$2:\$B\$16)) would return 0 or if date formatted , DD/MM/YYYY it would return 00/01/1900. How do you modify this formula in excel to ignore the nulls/zeros?
This comment was minimized by the moderator on the site