Use Excel XLOOKUP to Find an Inventory Value by Item and Date
Question details
Find an inventory value using both an item and a date in one formula.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- An inventory table identifies values by item and date, and the user needs the value where the two criteria intersect.
- Observed behavior
- The user can find each criterion separately but needs a single formula that returns the corresponding inventory value.
Check whether dates are column headers or stored in a separate date column; the formula depends on the table layout. Make sure the date criterion and table dates are actual Excel dates with matching values.
Nest XLOOKUP for an Item Row and Date Column
Use this formula when each item occupies one row and dates appear as column headers.
The inner XLOOKUP selects the column for the requested date. The outer XLOOKUP finds the item in that column and returns their intersection.
For example, put the item to find in F2 and the date to find in G2. Assume item names are in A2:A4, date headers are in B1:D1, and inventory values are in B2:D4.
Select an empty result cell, enter =XLOOKUP(F2,A2:A4,XLOOKUP(G2,B1:D1,B2:D4)), and press Enter.
Edit the ranges in the formula to match your table. Keep the item range aligned with the data rows and the date-header range aligned with the data columns.

Filter a List by Item and Date
Use FILTER when each inventory record has its own item, date, and value in separate columns.
Find an Item and Date Intersection in WPS Spreadsheets
Use INDEX and MATCH in WPS Spreadsheets to return the inventory value at the intersection of an item row and a date column.
- 1. Open the workbook: In WPS Spreadsheets, use Open to select your inventory workbook.
- 2. Enter the criteria: For this example, enter the item in F2 and the date in G2. Use A2:A4 for item names, B1:D1 for date headers, and B2:D4 for inventory values.
- 3. Calculate the intersection: Select an empty cell and enter =INDEX(B2:D4,MATCH(F2,A2:A4,0),MATCH(G2,B1:D1,0)), then press Enter. Adjust the ranges to fit your table.

Frequently Asked Questions
Why does the nested XLOOKUP return #N/A?
The item or date may not match the lookup range. Check the values in F2 and G2 against the item names and date headers, and make sure the dates are stored as dates rather than text.
What happens if an item or date appears more than once?
XLOOKUP returns the first match by default. For a list of records where you need every matching item and date, use FILTER instead.
Can I use XLOOKUP in Excel 2013?
No. Excel 2013 does not support XLOOKUP. For a table with item rows and date columns, use INDEX with two MATCH functions instead.
Why does FILTER return more than one value?
FILTER returns every row that meets both criteria. If several records have the same item and date, their values spill into multiple cells below the formula.




