Function Problems

Use Excel XLOOKUP to Find an Inventory Value by Item and Date

John WilsonJohn Wilson Dec 2, 2026 869 views

Question details

Find an inventory value using both an item and a date in one formula.

Find an Inventory Value by Item and Date with Excel XLOOKUP
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.
Before you start

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.

Solution 1Recommended

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.

1
Set up the criteria

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.

2
Enter the formula

Select an empty result cell, enter =XLOOKUP(F2,A2:A4,XLOOKUP(G2,B1:D1,B2:D4)), and press Enter.

3
Adjust the ranges

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.

Nest XLOOKUP for an Item Row and Date Column
Matching and availability: XLOOKUP returns the first exact match by default and returns #N/A if a criterion is not found. XLOOKUP is not available in Excel 2013.
Find values with WPS Spreadsheets

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. 1. Open the workbook: In WPS Spreadsheets, use Open to select your inventory workbook.
  2. 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. 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.
Look up an inventory value by both item and dateOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and menus
microsoft office alternative - wps office

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.