XLOOKUP function in Excel
What is XLOOKUP in Excel? It searches a range for a value and returns a matching result from another range — no column counting, no VLOOKUP fragility. Available in Excel 365, Excel 2021, and Google Sheets.
XLOOKUP syntax & arguments
The first three arguments are enough for most exact-match lookups. Keep lookup_array and return_array the exact same height (or width for horizontal lookups).
The value to find. It can be text, a number, a cell reference (e.g. E2), or the result of another formula.
The row or column where Excel should search for lookup_value (e.g. A2:A6).
The row, column, or table range to return from the matching position (e.g. C2:C6). Must match lookup_array dimensions.
The fallback result to return when no match is found (e.g. "Not found"). If omitted, Excel returns #N/A.
Controls exact, approximate, or wildcard matching:
Controls search direction or binary search method:
Excel XLOOKUP example
Column A lists employee IDs, column B lists names, and column C lists salaries. Cell E2 contains the ID to find: E-102.
| Employee ID | Name | Salary |
|---|---|---|
| E-101 | Ana | 72000 |
| E-102 | Ben | 64000 |
| E-103 | Chen | 81000 |
| E-104 | Dia | 59000 |
| E-105 | Eli | 77000 |
XLOOKUP searches A2:A6 for E-102 and returns 64000 from the same row in C2:C6. If the ID is missing, the formula returns Not found instead of #N/A.
How to use XLOOKUP in Excel
- Identify the lookup value and search column — Decide what you want to find (lookup_value, e.g. the employee ID in E2) and the row or column that contains those values (lookup_array, e.g. A2:A6).
- Point to the result column — Set return_array to the range holding the answer (e.g. C2:C6 for salaries). It must match the height of lookup_array exactly.
- Enter the formula and handle misses — Type =XLOOKUP(E2, A2:A6, C2:C6) and press Enter. Add "Not found" as the fourth argument so misses return friendly text instead of #N/A.
XLOOKUP with multiple criteria
Basic XLOOKUP matches a single value. To apply two or more conditions at once — say, find the salary for a given employee in a given department — multiply the boolean tests or join the values into one key:
Method 1: boolean multiplication (recommended)
Each test returns TRUE/FALSE; multiplying them leaves 1 only where every condition is true, and XLOOKUP finds that row.
Method 2: concatenation
Join criteria and ranges with a separator (&) so both sides form one combined lookup key. The same patterns also power two-way lookups that match a row and a column at once.
XLOOKUP vs VLOOKUP
XLOOKUP
Look up left or right. No column index number to count. Default exact match. Clean built-in not-found fallback.
VLOOKUP
Look up only to the right. Fragile when columns move or insert. Easy to forget the FALSE / 0 exact-match flag.
XLOOKUP vs INDEX MATCH
XLOOKUP
One function instead of two. Built-in if_not_found — no wrapping IFERROR. Identical syntax for left, right, or last-match lookups.
INDEX MATCH
Runs in every Excel version, including pre-2021 releases without XLOOKUP. Handles two-way lookups naturally with a row MATCH and a column MATCH inside INDEX.
Common mistakes & caveats
- #N/A — No exact match found; check trailing spaces, leading zeros, or text-vs-number formatting.
- #VALUE! — lookup_array and return_array have different lengths or dimensions.
- Fill formula down errors — Remember to lock ranges with $ (e.g. $A$2:$A$6) before dragging.
Related practice problems
Practice combining XLOOKUP and logic formulas in realistic, less-prescriptive spreadsheet challenges.
FAQ
What is the XLOOKUP function in Excel?
XLOOKUP is a lookup function available in Excel 365/2021 and Google Sheets. It searches a range (lookup_array) for a value and returns the item at the same position from another range (return_array), replacing both VLOOKUP and HLOOKUP.
What is the basic XLOOKUP syntax?
Use =XLOOKUP(lookup_value, lookup_array, return_array). The first three arguments cover most exact-match lookups.
What's the difference between VLOOKUP and XLOOKUP?
XLOOKUP can look left or right, needs no column index number, defaults to exact match, and includes a built-in if_not_found argument. VLOOKUP only looks right and breaks when columns are inserted or moved.
Is XLOOKUP better than VLOOKUP?
For most modern workbooks, yes. XLOOKUP can look left or right, needs no column index, defaults to exact match, and supports a custom not-found message.
XLOOKUP vs INDEX MATCH: which is better?
XLOOKUP is simpler — one function with a built-in not-found fallback. INDEX MATCH is still the right choice for Excel versions older than 2021, or for classic two-way lookups that match a row and a column at once.
Does XLOOKUP work in Google Sheets?
Yes. Google Sheets supports XLOOKUP with the same six-argument syntax, including if_not_found, match_mode, and search_mode.
How do I use XLOOKUP with multiple criteria?
Multiply boolean tests: =XLOOKUP(1, (A2:A6=E2)*(B2:B6=F2), C2:C6). Or concatenate the criteria into one key: =XLOOKUP(E2&F2, A2:A6&B2:B6, C2:C6).
Why do I get #N/A with XLOOKUP?
Usually there is no exact match. Check trailing spaces, text-vs-number mismatches, or confirm both arrays are the same height.