XLOOKUP searches a range for a key and returns the matching item from another range. Unlike VLOOKUP, it does not care which column the key is in, it defaults to an exact match, it can look from the bottom up, and it lets you choose what to show when nothing is found. For new spreadsheets it is the lookup function to reach for first.
Syntax
=XLOOKUP(search_key, lookup_range, result_range, [missing_value], [match_mode], [search_mode])
search_key: The value to look for.lookup_range: The single row or column to search in.result_range: The row or column to return a value from. It must be the same size aslookup_range.missing_value[Optional]: What to return when there is no match. If omitted,XLOOKUPreturns#N/A.match_mode[Optional]:0exact match (default)-1exact match, or the next smaller value1exact match, or the next larger value2wildcard match (*and?)
search_mode[Optional]:1search first to last (default)-1search last to first2binary search, ascending data-2binary search, descending data
Quick example
With product names in A2:A6 and prices in C2:C6:
=XLOOKUP("Stapler", A2:A6, C2:C6, "Not found")
Returns the price of the stapler, or Not found if the product is not in the list. Because the lookup range and the result range are separate, the price column can be anywhere: to the left of the names, on another sheet, or in a different file through IMPORTRANGE.
Looking to the left, with no column counting
With VLOOKUP you count columns and the key must be on the left. With XLOOKUP you point at the columns directly:
=XLOOKUP(E2, B2:B100, A2:A100)
This finds the value of E2 in column B and returns the matching item from column A. Inserting or deleting columns in the table does not break the formula, because nothing is hard-coded as a column number.
Match modes
Approximate match without sorting
VLOOKUP's approximate match needs sorted data. XLOOKUP with match_mode -1 returns the next smaller value and does not require the data to be sorted. For a tax-bracket or discount table where thresholds are in F2:F6 and rates in G2:G6:
=XLOOKUP(B2, F2:F6, G2:G6, , -1)
If the amount is 8,500 and the thresholds are 0, 5,000 and 10,000, it returns the rate for the 5,000 tier. Note the empty fourth argument, which skips missing_value.
Wildcards
Use match_mode 2 to match partial text:
=XLOOKUP("*" & E2 & "*", A2:A100, B2:B100, "No match", 2)
This returns the first row whose name contains the text in E2.
Search from the bottom: the latest entry
When a key appears several times, XLOOKUP returns the first match by default. Set search_mode to -1 to start from the bottom and get the most recent entry in a log:
=XLOOKUP(E2, A2:A1000, C2:C1000, "None", 0, -1)
This is a common way to get a customer's latest order or the last recorded price.
Return several columns at once
If the result range is several columns wide, XLOOKUP returns the whole matching row segment and spills it across cells:
=XLOOKUP(E2, A2:A100, B2:D100)
This returns the values of B, C and D for the matching row in a single formula.
Two criteria
To match on two columns, such as name and month, combine them inside the lookup:
=XLOOKUP(E2 & F2, ARRAYFORMULA(A2:A100 & B2:B100), C2:C100, "Not found")
Common errors
#N/A. No match, and nomissing_valuewas provided. Check for extra spaces (useTRIM) and for text-versus-number mismatches, such as"1001"against1001. Or pass amissing_value.#VALUE!.lookup_rangeandresult_rangeare not the same size, or you passed a two-dimensional lookup range. Each must be a single row or a single column, and they must have the same length.- Wrong row returned. Duplicate keys:
XLOOKUPreturns the first match unless you setsearch_modeto-1.
XLOOKUP vs. VLOOKUP vs. INDEX/MATCH
- Direction:
XLOOKUPandINDEX/MATCHlook left or right.VLOOKUPonly looks right. - Default match:
XLOOKUPandINDEX/MATCHare exact.VLOOKUPis approximate unless you passFALSE. - Not found:
XLOOKUPhas a built-inmissing_value. The others needIFERROR. - Column changes:
XLOOKUPreferences columns directly, so inserting columns is safe. - Compatibility: If a file will also be opened in older tools,
VLOOKUPandINDEX/MATCHare the most widely supported.
For a deeper comparison, see XLOOKUP vs INDEX-MATCH in Google Sheets 2026.
Video Example
Frequently asked questions
Is XLOOKUP case-sensitive? No. For a case-sensitive lookup, combine INDEX, MATCH and EXACT.
Can I look up an entire row or table? Yes, make result_range multiple columns wide. For all matches, not just the first, use FILTER.
Does XLOOKUP work with ARRAYFORMULA? Yes. Wrap it as ARRAYFORMULA(XLOOKUP(E2:E, ...)) to fill a column, though a spilling XLOOKUP over a range often does not need it.
Related Functions
VLOOKUP: The classic vertical lookup thatXLOOKUPreplaces.HLOOKUP: Horizontal lookup across the top row.INDEX: Returns the content of a cell by row and column offset.MATCH: Returns the relative position of an item in a range.FILTER: Returns all rows matching a condition, not just the first.