XLOOKUP practice

Write a real XLOOKUP left-lookup below and get instant mistake hints.

In F2, look up the Emp ID to the left of the name in E2, or show "Not found".

Syntax
XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found])
F2
fx
ABCDEF
1Emp IDNameDeptFind NameEmp ID
2E-201Tariq MansourDesignNadia Chen
3E-202Hannah ParkOps
4E-203Lukas NovakFinance
5E-204Nadia ChenData
6E-205Owen BrooksSales
7E-206Sofia RossiSupport

How XLOOKUP works

XLOOKUP finds a value in one column (lookup_array) and returns the matching row from any other column (return_array) — even to the left. Exact match is built in, and an optional 4th argument replaces #N/A with your own message.

=XLOOKUP(E2, B2:B7, A2:A7, "Not found")

The XLOOKUP arguments

lookup_value
What you are searching for. Here: E2 (Nadia Chen).
lookup_array
The single column or row to search. Here: B2:B7 (Name).
return_array
The column or row to return from — left or right. Here: A2:A7 (Emp ID).
[if_not_found]
Optional message when nothing matches, replacing #N/A. Here: "Not found".
[match_mode]
Optional: 0 (default) for exact match, -1 or 1 for next smaller/larger, 2 for wildcards.
[search_mode]
Optional: 1 (default) top-to-bottom, -1 bottom-to-top to find the last match.

5 common XLOOKUP mistakes

#VALUE! mismatched heights

lookup_array and return_array must have the same number of rows (B2:B7 and A2:A7, not A2:A6).

Whole table as lookup_array

Unlike VLOOKUP, XLOOKUP searches one column (B2:B7), not the entire table A2:C7.

Swapped lookup and return

Put the column containing the value you know first (B2:B7), then the column you want back (A2:A7).

Missing [if_not_found]

Without a 4th argument, any missing name displays #N/A instead of clean fallback text.

Stray spaces or text numbers

"Nadia Chen " with a trailing space will not match "Nadia Chen". Clean inputs with TRIM or VALUE.

XLOOKUP vs VLOOKUP vs INDEX/MATCH

FeatureXLOOKUPVLOOKUPINDEX/MATCH
Looks leftYesNoYes
Default matchExactApproximateApproximate (pass 0)
Built-in not-found textYes (4th arg)Needs IFNANeeds IFNA
Older Excel (2016/2019)Excel 2021 / 365+All versionsAll versions

FAQ

Why does XLOOKUP replace VLOOKUP for left lookups?

VLOOKUP can only search the leftmost column of a table and read to the right. XLOOKUP separates lookup_array and return_array into two independent ranges, so you can return a column to the left, default to an exact match, and avoid counting column numbers.

Why did my XLOOKUP return #VALUE!?

The most common cause is mismatched range sizes: lookup_array and return_array must cover the same number of rows (or columns for horizontal lookups), and lookup_array must be a single row or column, not a multi-column table.

Does XLOOKUP default to an exact match?

Yes. Unlike VLOOKUP (which defaults to approximate match unless you pass FALSE), XLOOKUP uses exact match (match_mode = 0) by default.

Which versions of Excel support XLOOKUP?

XLOOKUP is available in Excel for Microsoft 365, Excel 2021, Excel 2024, and Excel for the web. If you share workbooks with older Excel 2019 or 2016 users, use INDEX and MATCH for left lookups.