Use =XLOOKUP(lookup_value, lookup_array, return_array) to find a value in one range and return the matching result from another range.
=XLOOKUP("Notebooks", A2:A8, B2:B8)
You have a product list with prices and need to pull the price for a specific item into another table. XLOOKUP does this in one step, without counting columns like VLOOKUP requires.
Step by step
- Click the cell where you want the result.
- Type
=XLOOKUP(and then select the cell with the value you want to find (the lookup value). - Type a comma, then select the range that contains the values to search (the lookup array).
- Type a comma, then select the range that contains the result you want back (the return array).
- Type
)and press Enter. The result appears. - To copy the formula down, drag the fill handle or copy and paste it to other cells.
Try it here
Examples
1 Find a price by product name
Looks for the product name in column A and returns the matching price from column B. If the name is not found, XLOOKUP returns #N/A by default.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Product | Price | |||
| 2 | Pens | 4 | 6 | ||
| 3 | Pencils | 2 | |||
| 4 | Notebooks | 6 | |||
| 5 | Erasers | 1 | |||
| 6 | Markers | 8 | |||
| 7 | Folders | 5 | |||
| 8 | Stapler | 12 | |||
| 9 |
=XLOOKUP("Notebooks", A2:A8, B2:B8)2 Look up a value from a cell reference
Uses the value in D2 as the lookup value. If D2 contains "Markers", the formula returns the price from column B for that product.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Product | Price | ||||
| 2 | Pens | 4 | Markers | 8 | ||
| 3 | Pencils | 2 | ||||
| 4 | Notebooks | 6 | ||||
| 5 | Erasers | 1 | ||||
| 6 | Markers | 8 | ||||
| 7 | Folders | 5 | ||||
| 8 | Stapler | 12 | ||||
| 9 |
=XLOOKUP(D2, A2:A8, B2:B8)3 Return a custom message when not found
The fourth argument sets what to return if the lookup value is missing. Here it returns "Not in list" instead of #N/A.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Product | Price | |||
| 2 | Pens | 4 | Not in list | ||
| 3 | Pencils | 2 | |||
| 4 | Notebooks | 6 | |||
| 5 | Erasers | 1 | |||
| 6 | Markers | 8 | |||
| 7 | Folders | 5 | |||
| 8 | Stapler | 12 | |||
| 9 |
=XLOOKUP("Ruler", A2:A8, B2:B8, "Not in list")Other ways to do it
| Formula | Use it when |
|---|---|
=INDEX(B2:B8, MATCH("Notebooks", A2:A8, 0)) | Use when you are on an older Excel version that does not have XLOOKUP. |
=VLOOKUP("Notebooks", A2:B8, 2, FALSE) | Use when the lookup column is the first column of the table and you are comfortable counting columns. |
Practise it
Free exercises with instant feedback. No sign-up needed.
Common mistakes
- The lookup array and return array have different sizes. Make sure both ranges cover the same number of rows (or columns). XLOOKUP returns #VALUE! if they differ.
- The lookup value is not found and you get #N/A. Add a fourth argument with a custom message, like
=XLOOKUP(D2, A2:A8, B2:B8, "Not found"). - You forget to lock ranges when copying the formula down. Use absolute references like
$A$2:$A$8and$B$2:$B$8so the ranges stay fixed.
Questions people also ask
What is the difference between XLOOKUP and VLOOKUP?
XLOOKUP can look left or right, does not need column numbers, and has built-in not-found handling. VLOOKUP only looks to the right and needs a column index.
Can XLOOKUP return multiple columns at once?
Yes. If the return array has several columns, XLOOKUP spills the whole row of results.
Is XLOOKUP available in Excel 2016?
No. XLOOKUP is available in Microsoft 365, Excel 2021, and Excel for the web. For older versions, use INDEX and MATCH.
Functions used
Every formula on this page was checked by SheetSkill’s spreadsheet engine. All how-to guides