← Guides

XLOOKUP Complete Guide: 7 Practical Uses Beyond VLOOKUP

Exact match, approximate match, two-way lookups, last occurrence and multiple return columns: everything XLOOKUP can do, with ready-to-copy formulas.

Excel · 8 min read

By the FormulAI editorial team · Reviewed November 19, 2026

Sample data used in this guide

Sample table "Products" (formatted as an Excel Table, columns SKU to Price). Every formula in this guide uses it.
SKUNameCategoryPrice
A-101Wireless mouseAccessories19.90
A-102USB-C hubAccessories34.50
B-20127" monitorScreens229.00
B-20224" monitorScreens159.00
C-301Office chairFurniture189.00
C-302Standing deskFurniture349.00

Syntax in one line

XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode]). Unlike VLOOKUP there is no column number, and the default is an exact match, which removes the most common VLOOKUP mistake (forgetting FALSE).

=XLOOKUP(A2, Products[SKU], Products[Price], "Not found")
Expected result depending on the value typed in A2:
Value in A2Result
B-202159.00
A-10119.90
Z-999Not found

1. Return several columns at once

Pass a multi-column return range and the result spills horizontally. One formula retrieves name, category and price for a SKU.

=XLOOKUP(A2, Products[SKU], Products[[Name]:[Price]])
With A2 = C-301, the formula spills into three cells (Name, Category, Price):
NameCategoryPrice
Office chairFurniture189.00

2. Tiered pricing with approximate match

Match mode -1 returns the next smaller item, perfect for commission or shipping tiers. The table no longer needs to be sorted as it did with VLOOKUP TRUE.

=XLOOKUP(B2, Tiers[MinAmount], Tiers[Rate], , -1)
Tiers table: 0 → 0%, 500 → 5%, 1,000 → 8%, 2,500 → 12%. Result for several amounts in B2:
Amount (B2)Rate returned
4990 %
5005 %
1,2008 %
2,50012 %

3. Find the last occurrence

Search mode -1 scans from bottom to top. Use it to get the most recent status of a ticket or the last price paid by a customer.

=XLOOKUP(A2, Log[TicketID], Log[Status], , 0, -1)
Log: ticket T-17 appears three times (Open on 2 Mar, In progress on 4 Mar, Closed on 6 Mar). Searching from the bottom:
Ticket (A2)Mode 1 (first)Mode -1 (last)
T-17OpenClosed

4. Two-way lookup

Nest one XLOOKUP inside another to cross a row label and a column header, replacing the classic INDEX/MATCH/MATCH combination.

=XLOOKUP(G2, Sales[Region], XLOOKUP(H2, Sales[#Headers], Sales))
"Sales" table with a Region column and one column per month. With G2 = North and H2 = Feb, the formula returns the cell at the intersection:
RegionJanFebMarResult
North11,20012,40010,90012,400

5–7. Wildcards, multiple criteria, Google Sheets

Match mode 2 enables wildcards ("*north*"). For multiple criteria, look up 1 in a product of conditions: =XLOOKUP(1, (A:A=G2)*(B:B=H2), C:C). XLOOKUP also exists in Google Sheets with the same arguments. If colleagues still use Excel 2019, keep an INDEX/MATCH version, because XLOOKUP returns #NAME? there.

Common errors and how to fix them

#N/A

Cause: The lookup value does not exist exactly: a trailing space ("B-202 ") or a number stored as text on one side and as a number on the other.

Fix: Clean it with TRIM(A2) or convert it with VALUE(A2), and fill the 4th argument so a clear message replaces #N/A.

#VALUE!

Cause: The lookup array and the return array do not have the same height, for example A2:A100 and D2:D99.

Fix: Use Table references (Products[SKU], Products[Price]): they always have the same size.

#NAME?

Cause: The workbook is opened in Excel 2019 or older, where XLOOKUP does not exist.

Fix: Replace it with INDEX(Products[Price],MATCH(A2,Products[SKU],0)), which works in every version.

#SPILL!

Cause: The multi-column result cannot spill because cells to the right are not empty, or the formula sits inside a Table.

Fix: Clear the destination cells or move the formula outside the Table. Click the error icon to see which cell is blocking.

FAQ

Does XLOOKUP work in Google Sheets?

Yes, Google Sheets has offered XLOOKUP with the same syntax since 2022; the argument separator depends on the file's locale.

Is XLOOKUP slower than VLOOKUP?

On typical office files the difference is not noticeable. On hundreds of thousands of sorted rows, binary search mode (6th argument set to 2) speeds up calculation noticeably.

How do I look up with two criteria?

Multiply the conditions inside the lookup array: =XLOOKUP(1,(Products[Category]=F2)*(Products[Price]<G2),Products[Name]).

Go further

How this guide was made

Every formula, query and script in this guide was run on a real sample file (Excel 365, Google Sheets, PostgreSQL, MySQL or Python 3) before publication. We document the edge cases we hit during testing, such as text-formatted numbers, empty months or NULL values. AI helps us draft and translate; a human checks each example and updates the guide when software versions change. Spotted an error? Write to contact@formulai-app.com.