ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before the interview. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Lookups
  3. XLOOKUP in Excel: Everything a Beginner Needs

XLOOKUP in Excel: Everything a Beginner Needs

By ExcelReady Team·Updated October 30, 2026·7 min read

The short answer

XLOOKUP finds a value in one range and returns the matching item from another: =XLOOKUP(G2,B2:B9,A2:A9). It defaults to an exact match, can return a column on either side, and has a built-in if_not_found message instead of #N/A. It needs Excel 2021, Excel 2024 or Microsoft 365; it isn't in Excel 2019 or earlier.

Key takeaways

  • XLOOKUP needs three parts: what to find, where to look, and what to bring back.
  • It is an exact match by default, so there is no FALSE to forget.
  • The 4th argument, if_not_found, shows your own message instead of #N/A.
  • Match mode -1 or 1 handles bands, 2 turns on wildcards, and search mode -1 finds the last match.
  • XLOOKUP needs Excel 2021, Excel 2024 or Microsoft 365; use VLOOKUP or INDEX MATCH for older versions.
On this page+
  1. What is XLOOKUP and which Excel versions have it?
  2. XLOOKUP Excel syntax: the six arguments
  3. How to use XLOOKUP: a basic example
  4. How to show a message instead of #N/A
  5. Match modes and search modes
  6. Return several columns at once
  7. XLOOKUP vs VLOOKUP on the same task
  8. Common XLOOKUP mistakes
  9. Practise it

XLOOKUP is Excel's modern lookup: you tell it what to find, where to look and what to bring back, and it returns the match. The XLOOKUP Excel function defaults to an exact match, can look left or right, and lets you choose what to show when nothing is found. It needs Excel 2021, Excel 2024 or Microsoft 365. This guide is for beginners and for VLOOKUP users who want to switch.

What is XLOOKUP and which Excel versions have it?#

XLOOKUP is a lookup function that searches one range and returns the item in the same position from another range. It replaces VLOOKUP, HLOOKUP and most INDEX MATCH formulas with one function.

It is available in Microsoft 365, Excel 2021, Excel 2024 and Excel for the web, on Windows and Mac. It is not in Excel 2019, 2016 or earlier. If you open a file that uses XLOOKUP in one of those versions, the cells show #NAME?. So before you use it in a shared file, check what version your team uses. For a full side-by-side, read VLOOKUP vs XLOOKUP: which should you use?

XLOOKUP Excel syntax: the six arguments#

Only the first three arguments are required:

Excel formula
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
ArgumentWhat it meansDefault
lookup_valueWhat you want to findRequired
lookup_arrayThe column (or row) to searchRequired
return_arrayThe column (or row) to bring backRequired
if_not_foundWhat to show when there's no match#N/A
match_mode0 exact, -1 exact or next smaller, 1 exact or next larger, 2 wildcard0
search_mode1 first to last, -1 last to first, 2 or -2 binary search on sorted data1

The lookup_array and return_array must be the same size. There is no column number to count, which is why XLOOKUP keeps working when someone inserts a column. The XLOOKUP function guide has a short reference.

How to use XLOOKUP: a basic example#

Here is a cafe's stock list. The SKU is in column B, and the product name is to its left, in column A:

ABCD
1ProductSKUCategoryIn Stock
2Espresso Beans 1kgCF-101Coffee140
3Oat Milk 1LDR-220Dairy-Free85
4Paper Cups 12ozPK-310Packaging1200
5Vanilla SyrupSY-045Syrups36
6Decaf Beans 1kgCF-118Coffee22
7Cup Lids 12ozPK-315Packaging950
8Caramel SyrupSY-052Syrups0
9Almond Milk 1LDR-231Dairy-Free48

With a SKU in G2, this returns the product name:

Excel formula
=XLOOKUP(G2,B2:B9,A2:A9)

If G2 is SY-045, XLOOKUP finds it in the 4th row of B2:B9 and returns the 4th item of A2:A9: Vanilla Syrup. VLOOKUP can't do this, because it only returns columns to the right. See more ways to look up to the left in Excel.

To return a different column, change only the return_array: =XLOOKUP(G2,B2:B9,C2:C9) returns the category. Before you fill the formula down, lock both ranges with $ signs: =XLOOKUP(G2,$B$2:$B$9,$A$2:$A$9).

XLOOKUP returns a real value, so you can use it inside other formulas. This shows "Yes" when a SKU's stock is below 100:

Excel formula
=IF(XLOOKUP(H12,B2:B9,D2:D9)<100,"Yes","No")

For DR-220 (Oat Milk, 85 in stock) the result is Yes.

How to show a message instead of #N/A#

Put the message in the 4th argument, if_not_found. A SKU like PK-399 isn't in the list, so a plain XLOOKUP returns #N/A. This version shows a clear message instead:

Excel formula
=XLOOKUP(G2,$B$2:$B$9,$A$2:$A$9,"Not found")

You don't need to wrap XLOOKUP in IFERROR or IFNA. That is better, too: IFERROR would also hide real mistakes, like a misspelled function. Our guide on how to fix #N/A errors explains why a value might be "missing" when it looks like it's there, such as extra spaces.

Match modes and search modes#

The 5th and 6th arguments change how XLOOKUP matches and in which direction it searches.

Match mode (5th argument):

  • 0: exact match (the default).
  • -1: exact match, or the next smaller value. Use it for bands, like a rate that starts at 5 kg. =XLOOKUP(H2,$D$2:$D$6,$E$2:$E$6,,-1) returns the rate for a 7.5 kg parcel from the 5 kg band.
  • 1: exact match, or the next larger value. Use it to find the smallest box that fits.
  • 2: wildcard match, so "Riverside*" finds a name that starts with Riverside.

The two commas in ,,-1 skip the 4th argument. Unlike VLOOKUP with TRUE, modes -1 and 1 don't need a sorted list. Wildcards have their own guide: XLOOKUP wildcards and match modes explained.

Search mode (6th argument): -1 searches from the bottom up, so it returns the last match. With a list of orders in date order, =XLOOKUP(G2,B2:B50,D2:D50,,0,-1) returns the latest order for a customer.

Return several columns at once#

Give XLOOKUP a return_array that is more than one column wide, and the results spill into the cells next to it:

Excel formula
=XLOOKUP(G2,B2:B9,C2:D9)

This returns the Category and In Stock for the SKU in G2, in two cells side by side. The cells to the right must be empty, or you get a #SPILL! error.

XLOOKUP vs VLOOKUP on the same task#

To return a SKU's category, both functions work, but they ask different questions:

Excel formula
=VLOOKUP(G2,$B$2:$D$9,2,FALSE)
=XLOOKUP(G2,$B$2:$B$9,$C$2:$C$9)

VLOOKUP needs a table that starts at the SKU column, a column number you count by hand (Category is the 2nd column of B:D), and FALSE for an exact match. XLOOKUP needs only the column to search and the column to return. If someone inserts a column between SKU and Category, the VLOOKUP's 2 now points at the new column, while the XLOOKUP keeps returning the category. For a full comparison, see VLOOKUP vs XLOOKUP.

Common XLOOKUP mistakes#

  • Ranges of different sizes. =XLOOKUP(G2,B2:B9,A2:A8) returns #VALUE!. Make both ranges cover the same rows.
  • Swapping the ranges. The search range comes first, then the return range. Swapped, you search the names for a SKU and get #N/A.
  • Putting the match mode in the 4th place. =XLOOKUP(H2,D2:D6,E2:E6,-1) treats -1 as the not-found value, so a 7.5 kg parcel gets -1 instead of a rate. Use two commas to skip to the 5th argument.
  • Sharing with older Excel. A coworker on Excel 2019 sees #NAME?. Use VLOOKUP or INDEX MATCH for those files.

Lookups are a core skill in analyst work. See which others matter in our guide to Excel skills for data analysts.

Practise it#

XLOOKUP is easy to read but easy to mistype under time pressure, so practise it until the order of the ranges is automatic. ExcelReady's XLOOKUP lesson has you look up to the left, add a "Not found" message, return other columns and use XLOOKUP inside IF, in a live spreadsheet. Then move on to XLOOKUP wildcards and match modes, where you search partial names and place parcels into weight bands.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Click F2 and use XLOOKUP to return the name of the employee whose ID is in E2. Search the IDs in B2:B6, bring back the names in A2:A6 (to the left), and show "Not found" if there's no match.

fx
ABCDEFG
1
Name
Employee ID
Department
Employee ID
Name
2
Priya Shah
E-201
Finance
E-204
3
Tom Hale
E-202
Sales
4
Mei Wong
E-203
IT
5
Luca Bianchi
E-204
HR
6
Sara Novak
E-205
Sales
7
8
9

Tip: Three ranges in order: what you know (E2), where it is (the IDs), what you want back (the names). Then the message in quotes.

Practise this in a lesson

LessonXLOOKUPLook up in any direction with XLOOKUP and show a friendly message when nothing matches.LessonXLOOKUP wildcards and match modesSearch partial names with XLOOKUP's wildcard mode, and place values into tiers with next-smaller and next-larger matches.Function guideXLOOKUPXLOOKUP explained with real examples: exact matches, looking left and custom not-found messages, plus a live exercise to try now.

Frequently asked questions

Which versions of Excel have XLOOKUP?

+

XLOOKUP is in Microsoft 365, Excel 2021, Excel 2024 and Excel for the web. It is not in Excel 2019, 2016 or earlier; there, a file with XLOOKUP shows #NAME? errors.

Is XLOOKUP better than VLOOKUP?

+

For new work in modern Excel, usually yes: it looks left, defaults to an exact match and doesn't break when columns are inserted. VLOOKUP is still the safer choice when the file must open in older versions.

Does XLOOKUP need sorted data?

+

No. The default exact match works on any order, and match modes -1 and 1 also work on unsorted data. Only the binary search modes, 2 and -2, need sorted data.

How do I hide #N/A in XLOOKUP?

+

Use the 4th argument, if_not_found: =XLOOKUP(G2,B2:B9,A2:A9,"Not found"). You don't need IFERROR or IFNA.

Can XLOOKUP return more than one column?

+

Yes. Give it a return range several columns wide, like C2:E9, and the results spill into the cells to the right. That needs Excel's dynamic arrays, which come with every version that has XLOOKUP.

Sources

  • XLOOKUP function - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What is XLOOKUP and which Excel versions have it?
  2. XLOOKUP Excel syntax: the six arguments
  3. How to use XLOOKUP: a basic example
  4. How to show a message instead of #N/A
  5. Match modes and search modes
  6. Return several columns at once
  7. XLOOKUP vs VLOOKUP on the same task
  8. Common XLOOKUP mistakes
  9. Practise it

Keep reading

Lookups· 6 min read

How to Fix #N/A Errors in VLOOKUP and XLOOKUP

#N/A means "not available": the lookup couldn't find your value. First find the cause: extra spaces (fix with TRIM), numbers stored as text, a typo, or a table range that moved because it wasn't locked with $. If the item is truly missing, show a message with IFNA, or with XLOOKUP's 4th argument.

Lookups· 6 min read

How to Look Up to the Left in Excel

VLOOKUP can't look to the left: it searches the first column of its table and only returns columns to the right. To return a column on the left, use INDEX MATCH, =INDEX(A2:A9,MATCH(G2,B2:B9,0)), which works in every version, or XLOOKUP, =XLOOKUP(G2,B2:B9,A2:A9), in Excel 2021 or Microsoft 365.

Lookups· 6 min read

XLOOKUP Wildcards and Match Modes Explained

XLOOKUP uses wildcards only when its 5th argument, match_mode, is 2: =XLOOKUP("Riverside*",A2:A9,B2:B9,"Not found",2). The * stands for any number of characters and ? for exactly one. Match mode -1 returns an exact match or the next smaller value, and 1 the next larger, which is useful for bands and tiers.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free