Formula tool · Data lab

XLOOKUP Formula, Made Simple

=XLOOKUP(find, look in, bring back)

XLOOKUP finds a value in one column and brings back the matching value from another. Paste your tables below to get the exact formula for your data.

100% in your browser: your data never leaves your device

matching keys on both sheets! = equal keys

How does the XLOOKUP formula work?

ABCEF
1CodeProductPriceFindPrice
2P-101Pens1.20P-104 2.25
3P-102Paper3.99
4P-103Stapler6.50
5P-104Tape2.25
6P-105Folders0.80
F2 holds =XLOOKUP(E2, A2:A6, C2:C6) and shows 2.25.
  1. E2 is what to find: the code P-104.
  2. A2:A6 is where to look: the Code column. XLOOKUP goes down it until it finds P-104, in row 5.
  3. C2:C6 is what to bring back: the Price column. In row 5 it says 2.25, so that's the answer.
  4. ✎ No column numbers to count, and it matches exactly unless you ask it not to.

Get the XLOOKUP formula for your own data

Paste or upload your two tables, or try a sample. The formula appears under the result, written for your columns and ready to copy into Excel.

Step 01

Your list

100% in-browser
Step 02

Lookup table

100% in-browser

XLOOKUP examples you can copy

The first four use the example sheet at the top of the page: codes in column A, products in B, prices in C.

Show a message instead of #N/A

Add the text you want as a fourth part. It shows when the value isn't found:

=XLOOKUP(E2,A2:A6,C2:C6,"Not found")

Copy the formula down a column

Add $ signs so the ranges stay put when you fill the formula down. Without them, each row's ranges slide down one row and miss the top of the table.

=XLOOKUP(E2,$A$2:$A$6,$C$2:$C$6)
✎ E2 has no $, so it moves to E3, E4... as you copy down. The table doesn't move.

Look to the left

The column you bring back can be on either side. Find the code for a product name:

=XLOOKUP("Tape",B2:B6,A2:A6)
✎ Looks in B, brings back A. Gives P-104. VLOOKUP can't do this.

Bring back several columns at once

Give a range that is more than one column wide and the answers spill across:

=XLOOKUP(E2,A2:A6,B2:C6)
✎ Fills two cells: Tape and 2.25.

XLOOKUP with multiple criteria

To match on two columns, say first names in column A and last names in B, join the two names you're looking for with & and join the columns the same way:

=XLOOKUP(E2&F2,A2:A100&B2:B100,C2:C100)
✎ E2 holds the first name and F2 the last name. Brings back column C from the row where both match.

Find the last match instead of the first

For a log where the same item appears many times, such as price changes, search from the bottom:

=XLOOKUP(E2,A2:A100,C2:C100,"Not found",0,-1)
✎ The -1 at the end means search from last to first.

What do the optional parts of XLOOKUP do?

You only need the first three. The other three are there when you need them:

PartWhat it doesValues
if_not_foundWhat to show when there's no matchAny text or value, e.g. "Not found"
match_modeHow exact the match must be0 exact (the default), -1 exact or next smaller, 1 exact or next larger, 2 wildcards
search_modeWhich way to search1 top to bottom (the default), -1 bottom to top, 2 and -2 fast search on sorted data

Why is my XLOOKUP not working?

  • #N/A: the value isn't there exactly. The usual cause is a hidden space or a number stored as text. The tool above names the reason for each value it can't find, and VLOOKUP not working? walks through the same causes.
  • #NAME?: your Excel doesn't have XLOOKUP (Excel 2019 and older). Use INDEX and MATCH instead.
  • #VALUE!: the two ranges are different sizes, such as A2:A100 and C2:C90. Make them the same.
  • #SPILL!: you're bringing back several columns but the cells to the right aren't empty. Clear them.
  • Right at the top, wrong further down: the ranges moved when you copied the formula. Lock them with $ (try the lesson).

How can I practise XLOOKUP?

Each lesson takes a few minutes in a spreadsheet in your browser, and checks your formula as you go:

Still deciding between the two? See XLOOKUP vs VLOOKUP.

Visual guide: how XLOOKUP finds the answer

three arguments, any direction

=XLOOKUP(lookup_value, lookup_array, return_array)

Argument 01

lookup_value

The value you are looking for.

✎ Trim spaces first!

Argument 02

lookup_array

The column (or row) searched.

✎ Lock it with $ ($A$2:$A$500)

Argument 03

return_array

Where the answer comes from: left, right, above or below.

✎ Several columns spill across!

Revision Q&A

(click a question) Lab module 02
Q1: What is the XLOOKUP formula in Excel?

XLOOKUP finds a value in one column (or row) and brings back the value in the same position from another. The basic form is =XLOOKUP(what to find, where to look, what to bring back), for example =XLOOKUP(E2,A2:A6,C2:C6).

Q2: Which versions of Excel have XLOOKUP?

Excel for Microsoft 365, Excel 2021, Excel 2024 and Excel for the web. Excel 2019 and older do not have it and show #NAME? instead. In those versions use INDEX and MATCH.

Q3: Does XLOOKUP work in Google Sheets?

Yes. Google Sheets has XLOOKUP with the same arguments, so the formulas on this page work there too.

Q4: How do I use XLOOKUP with two criteria?

Join the two values you are looking for with &, and join the two columns the same way: =XLOOKUP(E2&F2,A2:A100&B2:B100,C2:C100). It finds the row where both columns match.

Q5: How do I stop XLOOKUP showing #N/A?

Add a fourth argument with the text to show instead: =XLOOKUP(E2,A2:A100,C2:C100,"Not found"). If you still see #N/A for values that look the same, check for extra spaces or numbers stored as text.

Q6: Is XLOOKUP better than VLOOKUP?

For new work, yes. XLOOKUP matches exactly by default, can bring back a column to the left, does not break when you insert a column, and has a built-in not-found message. VLOOKUP is still useful when a file must work in older Excel.

Q7: Is XLOOKUP case-sensitive?

No. "tape" and "TAPE" count as the same value.

Q8: Is my data uploaded when I use the tool?

No. The tool runs in your browser and your data never leaves your device.

Know someone fighting with a spreadsheet? Send them this page.