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?
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:
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.
Kutools for Excel: 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:
Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
More than 300 powerful features. Supports Office/Excel
2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features
30-day free trial. 60-day money back guarantee.