How to Find the Oldest Order Date and Return Its Order Number in Excel
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.

- 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.
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.
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.
Click on the blank cell where you want the final order number to appear.
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.
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 Dynamic Array Functions (TAKE, DROP, SORT, FILTER)
Utilize modern Excel dynamic array functions to filter the dataset by the item, sort it by date, and extract the first (oldest) result.
Sort the Data First, Then Use VLOOKUP
A simpler, non-formula-heavy approach where you manually sort the dataset by date before running a standard VLOOKUP.
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. Open your dataset in WPS Spreadsheet: Launch WPS Office and open your workbook containing the item, date, and order data.
- 2. Select the destination cell: Click the empty cell where you want to display the oldest order number.
- 3. Enter the lookup formula: Type the formula: =INDEX(C2:C100,MATCH(MIN(IF(A2:A100="Target Item",B2:B100)),B2:B100,0))
- 4. Execute the formula: Press Ctrl + Shift + Enter to process the array and instantly get the correct order number.

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.




