logo
search
Function Problems

How to Find the Oldest Order Date and Return Its Order Number in Excel

Emma BrownEmma Brown Sep 30, 2026 869 views

Question details

The user needs a formula to look up and return the specific order number associated with the oldest order date for a given item, bypassing VLOOKUP's default behavior of returning the first match.

How to Find the Oldest Order Date and Return Its Order Number in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
Performing data analysis or inventory management where multiple orders exist for the same item across different dates.
Observed behavior
Standard VLOOKUP functions only return the first matched item in the list, failing to identify and return the record with the minimum (oldest) date.
Before you start

Ensure that your date column is formatted as actual dates rather than text strings, and that all data ranges in your formula are of equal length.

Solution 1Recommended

Use INDEX, MATCH, MIN, and IF (Array Formula)

Combine these functions into an array formula to isolate the minimum date for a specific item and return the corresponding order number.

Since VLOOKUP stops at the first match it encounters, you must use an array formula with MIN and IF to evaluate all dates associated with your specific item. Once the oldest date is found, MATCH and INDEX work together to retrieve the corresponding order number.

1
Select the target cell

Click on the blank cell where you want the final order number to appear.

2
Enter the array formula

Type the formula: =INDEX(C2:C4,MATCH(MIN(IF(A2:A4="1001 SPARE PART",B2:B4)),B2:B4,0)). Adjust the ranges so that A contains the items, B contains the dates, and C contains the order numbers.

3
Execute the formula

Press Ctrl + Shift + Enter to evaluate the formula as an array. If you are using Excel 365 or Excel 2021, you can simply press Enter.

Use INDEX, MATCH, MIN, and IF (Array Formula)
Lock Your References: If you plan to drag this formula down to apply it to multiple items, ensure you lock your ranges with absolute references (e.g., $A$2:$A$100).
Solve it Easily in WPS Spreadsheet

Extract Complex Data Matches Easily with WPS Office

WPS Spreadsheet provides seamless support for advanced array formulas and modern lookup functions, allowing you to quickly extract precise data like the oldest order dates without compatibility issues.

  1. 1. Open your dataset in WPS Spreadsheet: Launch WPS Office and open your workbook containing the item, date, and order data.
  2. 2. Select the destination cell: Click the empty cell where you want to display the oldest order number.
  3. 3. Enter the lookup formula: Type the formula: =INDEX(C2:C100,MATCH(MIN(IF(A2:A100="Target Item",B2:B100)),B2:B100,0))
  4. 4. Execute the formula: Press Ctrl + Shift + Enter to process the array and instantly get the correct order number.
100% compatible with Microsoft Excel formulas (.xlsx)Fully supports advanced array functions like INDEX, MATCH, MIN, and IFFamiliar user interface requiring no learning curveLightweight, fast, and completely free to download
microsoft office alternative - wps office

Frequently Asked Questions

Why does VLOOKUP return the wrong date when there are duplicates?

VLOOKUP searches your data from top to bottom and stops at the very first exact match it finds. If your dataset isn't sorted by date, the first match it hits might not be the oldest one, which is why an array formula or pre-sorting is required.

Do I always need to press Ctrl + Shift + Enter for MIN and IF?

In older versions of Excel, you must press Ctrl + Shift + Enter to evaluate the formula as an array. In Microsoft 365 or newer versions of WPS Office, the modern dynamic array engine allows you to simply press Enter.

Can I use XLOOKUP to find the oldest date?

Yes, but only if your data is already sorted by date in ascending order, as XLOOKUP will return the first match by default. Alternatively, XLOOKUP can be nested with MIN and IF just like the INDEX and MATCH combination.

What happens if there are multiple orders on the exact same oldest date?

If there is a tie for the oldest date, the INDEX and MATCH formula combination will return the order number of the first occurrence of that specific minimum date reading from the top of your dataset.