Business tasks · Excel formula

Look up a product price

Use XLOOKUP to return a price from a product list.

Illustrated spreadsheet concept

Use this formula

=XLOOKUP(E2,A2:A5,B2:B5,"Not found")

The example below uses the column letters and row numbers in the formula. Enter it in a blank cell after the sample data.

See the cells and result

Visual example for Look up a product price with sample rows and expected result

Example data

RowProductPriceFind product
2Notebook12Folder
3Marker4
4Folder7
5Stapler16

Expected result: 7.

Why it works

XLOOKUP finds the value in E2 in A2:A5 and returns the price from the corresponding row in B2:B5.

Check this: XLOOKUP is available in current Microsoft 365 and recent standalone Excel releases. Older versions may require INDEX and MATCH.

Excel versions and testing

Microsoft 365, Excel 2021, or Excel 2024. XLOOKUP is unavailable in Excel 2016 and 2019.

This original example has been checked against the browser formula engine and the downloadable workbook structure. The workbook has not been verified in every Excel edition. Microsoft function reference.

Common mistake and fix

If #NAME? appears, check your Excel version. In Excel 2016 or 2019, use INDEX and MATCH for an equivalent lookup. If the result is missing, check spaces in the lookup value.

Try it yourself

Change a number or label in the data and predict the new result. Use the practice lab to test a supported formula, or download the data to work in Excel.

Try this example onlineDownload Excel workbookDownload CSV