Back to functions
Lookup2026-03-189 related articles

XLOOKUP Function in Excel

Search a range or array for a match and return a corresponding item from a second range or array.

Syntax

XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])

Arguments

lookup_value

Required

The value to search for.

lookup_array

Required

The range or array to search in.

return_array

Required

The range or array from which to return a result.

if_not_found

Optional

The value to return when no match is found. If omitted, XLOOKUP returns

match_mode

Optional

0 = exact match (default), -1 = exact or next smaller, 1 = exact or next larger, 2 = wildcard match.

search_mode

Optional

1 = first to last (default), -1 = last to first, 2 = binary ascending, -2 = binary descending.

What it returns

Returns the corresponding value from the return_array for the first match found in the lookup_array.

What XLOOKUP does

XLOOKUP searches a column or row for a value and returns a result from the same position in a different column or row. It replaces VLOOKUP, HLOOKUP, and many INDEX/MATCH combinations with a single, more flexible function.

Key advantages over VLOOKUP: XLOOKUP can look left, does not require a column index number, defaults to exact match, and has a built-in error handler.

Practical examples

Look up a product price

=XLOOKUP(D2,A2:A100,C2:C100,"Not found")

Searches column A for the value in D2 and returns the corresponding price from column C. Returns "Not found" instead of an error when there is no match.

Look up with approximate match

=XLOOKUP(B2,E2:E10,F2:F10,,-1)

Finds the exact match or the next smaller value. Useful for tax brackets, shipping tiers, or grading scales.

Return multiple columns

=XLOOKUP(A2,Products[ID],Products[Name]:Products[Price])

XLOOKUP can return an entire row of results when the return_array spans multiple columns.

Common mistakes and notes

XLOOKUP replaces VLOOKUP in most cases

VLOOKUP only searches the leftmost column and requires a column index. XLOOKUP searches any column and returns from any column, making it more reliable when columns are added or reordered.

Default is exact match

Unlike VLOOKUP, which defaults to approximate match, XLOOKUP defaults to exact match. This prevents a common class of VLOOKUP errors.

Availability

XLOOKUP is available in Excel 365 and Excel 2021. It is not available in Excel 2019 or earlier.

Related functions

Related articles

Deep dives, troubleshooting guides, and practical examples that use XLOOKUP.

AI in ExcelAdvanced
2026-03-18

The Karpathy Loop for Excel: How Autoresearch Changes the Way We Optimize Spreadsheets

Learn how Karpathy's autoresearch pattern — the AI experiment loop that ran 700 tests in two days — applies to Excel formula optimization, VBA macros, and AI-assisted spreadsheet workflows....

#ai#automation#chatgpt#claude#formulas#vba#optimization
9 min read
Read Article
AI in ExcelFormulas
2026-01-22

Can AI Fix Broken Excel Formulas? Real Tests With VLOOKUP, XLOOKUP, and SUMIFS

I tested whether AI can fix broken Excel formulas in real scenarios involving VLOOKUP, XLOOKUP-style logic, and SUMIFS errors caused by dirty data....

#ai#formulas#troubleshooting#benchmark#vlookup
4 min read
Read Article
AI in ExcelAdvanced
2025-11-14

AI in Excel: Practical Guide to Copilot, ChatGPT, Claude, and Gemini

Learn how to use AI in Excel with Copilot, ChatGPT, Claude, and Gemini. Compare strengths, limitations, use cases, and how to verify AI-generated formulas, analysis, and automation....

#ai#copilot#chatgpt#claude#gemini#data-analysis#automation
16 min read
Read Article
FormulasTroubleshooting
2025-10-09

How to Fix Common XLOOKUP Errors in Excel

Fix common XLOOKUP errors in Excel, including #N/A, spill problems, mismatched ranges, and text cleanup issues that break lookups....

#xlookup#troubleshooting#errors#lookup
4 min read
Read Article
FormulasIntermediate
2025-08-28

How to Use XLOOKUP with Wildcards for Partial Matches

Learn how to use XLOOKUP with wildcards in Excel for partial matches, contains searches, and messy text that does not match exactly....

#xlookup#wildcard#partial-match#text-cleanup
4 min read
Read Article
FormulasIntermediate
2025-07-10

How to Return Multiple Columns and Rows with XLOOKUP

Learn how to use XLOOKUP to return multiple columns or rows in Excel and how spill behavior changes the way lookup formulas work....

#xlookup#dynamic-arrays#lookup#spill-formulas
5 min read
Read Article
FormulasIntermediate
2025-05-15

How to Use XLOOKUP with Multiple Criteria in Excel

Learn how to use XLOOKUP with multiple criteria in Excel by combining Boolean logic or concatenation for cleaner, more flexible lookups....

#xlookup#multiple-criteria#lookup#formulas
5 min read
Read Article
FormulasComparison
2025-03-27

XLOOKUP vs VLOOKUP in Excel: Which Should You Use?

Compare XLOOKUP vs VLOOKUP in Excel, including syntax, left lookups, exact matches, and when the older function still makes sense....

#xlookup#vlookup#comparison#lookup
5 min read
Read Article
FormulasBeginner
2025-02-13

XLOOKUP Function in Excel: Step-by-Step Guide for Beginners

Learn how to use XLOOKUP in Excel with beginner-friendly steps, practical examples, and a clear comparison with VLOOKUP, HLOOKUP, and INDEX MATCH....

#xlookup#lookup#excel-formulas#beginner-guide
9 min read
Read Article

Official documentation