Learning Guides
XLOOKUP in Excel: How to Use It (12 Tested Examples + Error Fixes)
Learn XLOOKUP in Excel with 12 tested examples: left lookup, last match, multiple criteria, two sheets and regex, plus a fix for every XLOOKUP error.

You've heard XLOOKUP replaces VLOOKUP. Then you type it, get #NAME? or #N/A, and go back to the formula you already know.
This guide fixes that for good. You'll learn how XLOOKUP in Excel works, 12 examples from basic to advanced, and how to fix every error it throws.
All examples use one small practice table you can type into a blank sheet in two minutes, and the key examples come with a backup formula for Excel 2019.
XLOOKUP in Excel is a lookup function that searches one column or row for a value and returns the matching item from another column or row. It defaults to an exact match, can look left or right, and shows a custom message when nothing is found. It works in Microsoft 365, Excel 2021, Excel 2024 and Excel for the web.
Quick answer: XLOOKUP in Excel (November 2026)
- The XLOOKUP syntax is
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode]); only the first three arguments are required.- XLOOKUP uses an exact match by default, so it never needs a FALSE argument the way VLOOKUP does.
- XLOOKUP can look left, return several columns at once, and find the last match with search_mode -1.
- Microsoft lists XLOOKUP for Microsoft 365, Excel 2024, Excel 2021 and Excel for the web, but not Excel 2016 or Excel 2019, where it shows #NAME?.
- Regex matching (match_mode 3) was announced in August 2024 and works only in Excel for Microsoft 365.
The Practice Data Used in This Guide
Every example below runs on one fictional dataset: 8 students at a Nagpur training institute, spread across the Sadar, Mate Square and Nandanvan centres. The fees are sample numbers for practice, not real course fees. Type the headers in row 1 and the students in rows 2 to 9.
| Row | A: ID | B: Name | C: Course | D: Centre | E: Fee (₹) | F: Mentor |
|---|---|---|---|---|---|---|
| 2 | FB101 | Aarav | Data Analytics | Sadar | 45,000 | Meera |
| 3 | FB102 | Priya | Data Science | Mate Square | 60,000 | Arjun |
| 4 | FB103 | Rahul | MERN Stack | Nandanvan | 40,000 | Arjun |
| 5 | FB104 | Sneha | Data Analytics | Mate Square | 45,000 | Meera |
| 6 | FB105 | Imran | Power BI | Sadar | 15,000 | Nikhil |
| 7 | FB106 | Kavya | Data Science | Nandanvan | 60,000 | Arjun |
| 8 | FB107 | Rohit | Data Analytics | Sadar | 45,000 | (blank) |
| 9 | FB108 | Priya | Power BI | Nandanvan | 15,000 | Nikhil |
Two details are deliberate. There are two students named Priya, and FB107 has no mentor. Both come back later.
How we checked: every expected result in this article was worked through on 30 November 2026 against a Python model of XLOOKUP's documented behaviour on this exact table. Type the table in and you can confirm each one in your own Excel.
XLOOKUP Syntax in Excel: The What, Where, Return Rule
XLOOKUP needs three things: what to find, where to look for it, and what to return. Microsoft documents the full syntax on its XLOOKUP function page:
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
We call the first three arguments the What, Where, Return rule. Say it out loud while typing and you'll rarely mix up the order.
| Argument | Required? | What it means | Example |
|---|---|---|---|
| lookup_value | Yes | What to find | "FB104" or H2 |
| lookup_array | Yes | Where to look (one column or row) | A2:A9 |
| return_array | Yes | What to Return | B2:B9 |
| if_not_found | No | Message instead of #N/A | "ID not found" |
| match_mode | No | 0 exact (default), -1 exact or next smaller, 1 exact or next larger, 2 wildcard, 3 regex | -1 for slabs |
| search_mode | No | 1 first to last (default), -1 last to first, 2 and -2 binary search on sorted data | -1 for the latest entry |
Match mode 3 (regex) isn't on Microsoft's main page yet. Microsoft announced it on the Microsoft 365 Insider blog in August 2024, and Ablebits notes it only works in Excel for Microsoft 365.
Pro tip: lookup_array and return_array must be the same size. A2:A9 with B2:B10 gives #VALUE!, which is the first thing to check when a new formula breaks.

How to Use XLOOKUP in Excel, Step by Step
To use XLOOKUP in Excel, click an empty cell, type =XLOOKUP(, then select the value to find, the column to search and the column to return, and press Enter. Here's the full process with our data, finding the name for ID FB104.
- Click an empty cell, for example H3.
- Type the lookup value in another cell. Put
FB104in H2 so you can change it later. - Start the formula: type
=XLOOKUP(and click H2, then type a comma. - Select where to look: drag over A2:A9 (the ID column), then type a comma.
- Select what to return: drag over B2:B9 (the Name column).
- Close the bracket and press Enter.
=XLOOKUP(H2, A2:A9, B2:B9)
Result: Sneha. Type FB101 in H2 and the answer changes to Aarav instantly.

If you'll copy the formula down a column, lock the ranges with $ (select the range and press F4): =XLOOKUP(H2, $A$2:$A$9, $B$2:$B$9). Unlocked ranges slide down as you copy and later rows start returning #N/A.
XLOOKUP Formula in Excel With Example: 12 Use Cases
The 12 XLOOKUP examples below cover almost every lookup task in an office sheet, from a basic exact match to regex. Each shows the formula and the result on our practice data.
1. Basic exact match
=XLOOKUP("FB104", A2:A9, B2:B9)
Result: Sneha. No column number to count, and no FALSE needed, because exact match is the default.
2. Custom "not found" message
=XLOOKUP("FB120", A2:A9, E2:E9, "ID not found")
Result: ID not found instead of #N/A. FB120 doesn't exist, so the fourth argument kicks in. Use a clear message: anyone reading the report knows the ID is wrong, not the formula.
3. Look left
=XLOOKUP("Imran", B2:B9, A2:A9)
Result: FB105. The ID column sits to the left of the Name column. VLOOKUP can't do this without rearranging the table.
4. Return several columns at once
=XLOOKUP("FB102", A2:A9, C2:E9)
Result: Data Science | Mate Square | 60,000, spilled across three cells. Point return_array at three columns and XLOOKUP returns all three. In Microsoft 365 and Excel 2021, XLOOKUP is a dynamic array formula, so the results spill automatically into the cells to the right.

5. Find the last match
Priya appears twice. A normal lookup returns the first row:
=XLOOKUP("Priya", B2:B9, C2:C9)
Result: Data Science (FB102, row 3). Add search_mode -1 to search from the bottom up:
=XLOOKUP("Priya", B2:B9, C2:C9, , 0, -1)
Result: Power BI (FB108, the latest entry). This is the cleanest way to get the most recent record in a log, like the latest payment or status update. The empty space between the commas skips if_not_found.

6. Approximate match for slabs and tiers
Discount slabs live on a separate sheet named Discount: ₹0 gets 0%, ₹20,000 gets 5%, ₹40,000 gets 10%, ₹60,000 gets 15%.
=XLOOKUP(E2, Discount!A2:A5, Discount!B2:B5, , -1)
match_mode -1 turns on an approximate match: "exact match, or the next smaller value". Results on our data: ₹45,000 returns 10%, ₹15,000 returns 0%, and ₹60,000 returns 15% (exact hit). Unlike VLOOKUP's approximate mode, the slab table doesn't have to be sorted for this to work.
7. Wildcard match
=XLOOKUP("Ka*", B2:B9, A2:A9, , 2)
Result: FB106 (Kavya). * means any characters and ? means one character.
The catch: you must set match_mode to 2. With the default exact match, the same formula returns #N/A, because XLOOKUP looks for a name literally spelled "Ka*".
8. Multiple criteria
Covered in its own section below, because it's the most searched advanced use: XLOOKUP with multiple criteria.
9. Two-way lookup (row and column)
=XLOOKUP("FB103", A2:A9, XLOOKUP("Centre", A1:F1, A2:F9))
Result: Nandanvan. The inner XLOOKUP finds the "Centre" column in the header row and returns that whole column.
The outer XLOOKUP then finds FB103 in it. Change "Centre" to "Fee" and the same formula returns 40,000.
Microsoft uses the same nested pattern to replace HLOOKUP.
10. Lookup from another sheet
Covered with a worked example in XLOOKUP between two sheets.
11. Regex match (Microsoft 365 only)
=XLOOKUP("^Mate", D2:D9, B2:B9, , 3)
Result: Priya, the first student whose centre starts with "Mate". ^ means "starts with".
Regex helps with messy data where the same thing is typed several ways. For example, "Nagpur|NGP" matches either spelling of the city. If your Excel isn't Microsoft 365, this returns an error, so stick to wildcards there.
12. Show a blank instead of 0
FB107 has no mentor, yet this formula returns 0:
=XLOOKUP("FB107", A2:A9, F2:F9)
Excel returns 0 when the matching cell is empty, which looks like a real value in a report. The fix uses LET to test the result once:
=LET(r, XLOOKUP("FB107", A2:A9, F2:F9), IF(r="", "", r))
Result: a blank cell. A shorter trick, =XLOOKUP(...)&"", also works but turns numbers into text, so avoid it for fees or quantities.
XLOOKUP in Excel With Multiple Criteria
To use XLOOKUP with multiple criteria, multiply the conditions together and look up the number 1. Each condition returns TRUE or FALSE, and multiplying turns them into 1s and 0s, so only the row where every condition is true becomes 1. Exceljet explains this boolean method in detail.
We need the ID for the Priya who studies Power BI:
=XLOOKUP(1, (B2:B9="Priya") * (C2:C9="Power BI"), A2:A9)
Result: FB108. Here's what happens inside:
| Row | Name = "Priya" | Course = "Power BI" | Multiplied |
|---|---|---|---|
| 3 (FB102) | 1 | 0 | 0 |
| 6 (FB105) | 0 | 1 | 0 |
| 9 (FB108) | 1 | 1 | 1 |
| All others | 0 | 0 | 0 |
Add a third condition the same way: * (D2:D9="Nandanvan"). For OR logic (either condition is enough), add the conditions instead and test for a result above 0: =XLOOKUP(1, --(((B2:B9="Priya") + (C2:C9="Power BI")) > 0), A2:A9).
Excel 2019 fallback: =INDEX(A2:A9, MATCH(1, (B2:B9="Priya")*(C2:C9="Power BI"), 0)), entered with Ctrl + Shift + Enter.

XLOOKUP in Excel Between Two Sheets
To use XLOOKUP between two sheets, point lookup_array and return_array at the other sheet by typing its name followed by an exclamation mark, or by clicking the sheet tab while building the formula. Excel adds the sheet name for you.
Say a Payments sheet lists receipts by student ID, and the student table above sits on a sheet named Students. We pull each student's fee from Students and calculate the balance:
=XLOOKUP(B2, Students!$A$2:$A$9, Students!$E$2:$E$9, "Check ID")
| Receipt | Student ID | Paid (₹) | Fee (XLOOKUP) | Balance |
|---|---|---|---|---|
| R-501 | FB101 | 20,000 | 45,000 | 25,000 |
| R-502 | FB106 | 60,000 | 60,000 | 0 |
| R-503 | FB105 | 5,000 | 15,000 | 10,000 |
| R-504 | FB130 | 10,000 | Check ID | Check ID |
The balance column uses =IF(ISNUMBER(D2), D2-C2, "Check ID"), so a typo in one ID flags itself instead of breaking the total.

Two tips. Sheet names with spaces need single quotes, like 'Fee List'!A2:A9.
And if you look up from a different workbook, keep it open: CareerFoundry notes that XLOOKUP returns #REF! when the source workbook is closed.
This is the same idea as joining two tables in SQL. If you're learning both, our joins in SQL guide shows how a lookup maps to a LEFT JOIN.
The XLOOKUP Error Decoder
The XLOOKUP Error Decoder is our one-table checklist that matches each XLOOKUP symptom to its usual cause and fix. Most guides only cover #N/A. These are the seven problems you'll actually meet.
| Symptom | Usual cause | Fix |
|---|---|---|
| #N/A | Value not found: trailing spaces, or a number stored as text in one column | Wrap the value in TRIM(); convert text numbers with Data > Text to Columns; add an if_not_found message |
| #NAME? | Excel 2016 or 2019 (no XLOOKUP), or a typo in the function name | Use the INDEX + MATCH fallback; check the spelling |
| #VALUE! | lookup_array and return_array are different sizes | Make both ranges cover the same rows, e.g. A2:A9 and B2:B9 |
| #SPILL! | A multi-column result is blocked by data, merged cells, or sits inside an Excel Table | Clear the cells to the right, unmerge, or move the formula outside the Table |
| #REF! | The source workbook is closed | Open the source workbook, or copy the data in |
| 0 instead of blank | The matching cell is empty | Use the LET pattern from example 12 |
| Wrong answer, no error | search_mode 2 or -2 (binary search) on unsorted data | Remove search_mode, or sort the data first |
The #SPILL! row surprises many people.
Microsoft's #SPILL! guide confirms that spilled array formulas aren't supported inside Excel Tables, so a multi-column XLOOKUP typed inside a Table fails even when the cells beside it look empty.
The last row is the dangerous one. Microsoft's page warns that binary search on unsorted data returns invalid results, and Excel shows no error at all. Unless you're working with hundreds of thousands of rows, leave search_mode alone.

XLOOKUP Not Showing in Excel? The Version Problem
If XLOOKUP doesn't appear when you type it, or a file shows #NAME?, your Excel version doesn't support it. Microsoft states that XLOOKUP isn't available in Excel 2016 or Excel 2019. It works in Microsoft 365, Excel 2024, Excel 2021, Excel for the web and the Excel mobile apps.
This matters in India more than most tutorials admit. Plenty of office desktops and college computer labs still run perpetual Office 2016 or 2019 licences.
You build a clean XLOOKUP sheet at home on Microsoft 365, email it to a manager on Office 2019, and every formula shows #NAME? once the sheet recalculates.
Three ways to handle it:
- Check your version first. Go to File > Account > About Excel. If it says 2016 or 2019, XLOOKUP won't work.
- Use the fallback when the file will be shared.
=INDEX(B2:B9, MATCH("FB104", A2:A9, 0))returns Sneha in every Excel version. - Use Excel for the web or Google Sheets. Both are free with an account. Google Sheets added XLOOKUP in August 2022, as Ben Collins documented.

XLOOKUP vs VLOOKUP: Quick Comparison
XLOOKUP is the safer choice whenever everyone on a file has Microsoft 365 or Excel 2021+, while VLOOKUP still wins when the file must open in Excel 2019 or older.
| Feature | XLOOKUP | VLOOKUP |
|---|---|---|
| Default match | Exact | Approximate (if 4th argument is left out) |
| Look left | Yes | No |
| Breaks when a column is inserted | No | Yes (column number is fixed) |
| Built-in "not found" message | Yes | No, needs IFNA |
| Last match | Yes (search_mode -1) | No |
| Return several columns | Yes | No |
| Excel 2016 / 2019 | No | Yes |
We tested how VLOOKUP fails in practice, including a missing FALSE that gave wrong prices on 4 of 8 orders without a single error. That full side-by-side test is in our guide to Excel IF, VLOOKUP and XLOOKUP.
Practice Exercises
Six exercises on the same student table, each with one correct answer. For task 5, add the four-row Discount sheet from example 6. Try them before checking the expected results.
| # | Task | Expected result |
|---|---|---|
| 1 | Course for FB105 | Power BI |
| 2 | ID for Rahul (look left) | FB103 |
| 3 | Fee for FB199 with a message | ID not found |
| 4 | Priya's latest centre | Nandanvan |
| 5 | Discount for a ₹20,000 fee | 5% |
| 6 | ID for Sneha in Data Analytics at Mate Square | FB104 |
Hint: task 4 needs search_mode -1, and task 6 needs three conditions multiplied together.
Once lookups feel easy, build a report on top of the same data. Our Power BI dashboard tutorial picks up where Excel lookups stop.
Now It's Your Turn
You now know how XLOOKUP in Excel works: What, Where, Return, plus three optional arguments that handle missing values, slabs, wildcards and the latest entry.
Start small. Open one sheet you use at work, replace a single VLOOKUP with XLOOKUP, and add an if_not_found message. Then keep the Error Decoder handy for the day something breaks.
XLOOKUP comes up often in Excel rounds for MIS and analyst jobs. Our data analyst interview questions guide covers what else to prepare.
If you want a trainer to take you from lookups to pivot tables, SQL and Power BI on real projects, the data analyst course in Nagpur covers them end to end. Not sure where to start? Book a free career counselling session.
FAQ
What is XLOOKUP in Excel?
XLOOKUP in Excel is a lookup function that finds a value in one column or row and returns the matching item from another. It uses an exact match by default, can look left, can return several columns, and shows a custom message instead of #N/A. It replaces VLOOKUP and HLOOKUP in Microsoft 365, Excel 2021 and Excel 2024.
What is the XLOOKUP formula?
The formula is =XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode]). Only the first three are required: what to find, where to look, and what to return. For example, =XLOOKUP("FB104", A2:A9, B2:B9) finds ID FB104 in column A and returns the name from column B.
Why is XLOOKUP not showing in my Excel?
Your Excel version probably doesn't support it, because Microsoft says XLOOKUP isn't available in Excel 2016 or Excel 2019. Check under File > Account > About Excel, then use INDEX and MATCH instead, or open the file in Excel for the web or Google Sheets, which both support XLOOKUP.
Can XLOOKUP return multiple values?
Yes. Point return_array at several columns, such as C2:E9, and XLOOKUP returns all of them for the matching row, spilling into the cells to the right. If you need every matching row rather than one row, use the FILTER function instead.
How do I use XLOOKUP with multiple criteria?
Multiply the conditions and look up 1: =XLOOKUP(1, (B2:B9="Priya")*(C2:C9="Power BI"), A2:A9). Each condition gives 1 or 0, so only the row where all conditions are true equals 1. Add more conditions with another *.
Is XLOOKUP better than VLOOKUP?
For most work, yes. XLOOKUP defaults to an exact match, looks left, doesn't break when columns are inserted and has a built-in "not found" message. VLOOKUP is still the better choice when a file must work in Excel 2019 or older, where XLOOKUP shows #NAME?.
Why does XLOOKUP return 0 instead of a blank?
XLOOKUP returns 0 when the matching cell is empty. Wrap it in LET and test the result: =LET(r, XLOOKUP(...), IF(r="", "", r)). Adding &"" also works, but it converts numbers to text.
Sources
- XLOOKUP function, Microsoft Support, accessed November 2026
- New regex modes for XLOOKUP and XMATCH, Microsoft 365 Insider blog, August 2024
- Excel XLOOKUP and XMATCH with regex match, Ablebits
- Excel XLOOKUP function, Exceljet, accessed November 2026
- How to correct a #SPILL! error, Microsoft Support, accessed November 2026
- How to use the XLOOKUP function in Excel, CareerFoundry
- New functions in Google Sheets (2022), Ben Collins, 2022
- Fireblaze AI School practice table, expected results worked through with a Python model of XLOOKUP's documented behaviour, 30 November 2026