What is XLOOKUP in Google Sheets?

XLOOKUP searches a lookup array for a key and returns a matching value from a return array. It handles left lookups, approximate match, and custom not-found text without INDEX/MATCH gymnastics.

When to use it

Use XLOOKUP for price lists, employee records, and SKU tables when keys may appear anywhere relative to the return column.

When to skip it

Skip XLOOKUP on unsorted huge tables needing binary search without understanding search_mode. Legacy files with stable VLOOKUP may not need migration yet.

How it works

  1. 1

    Put the search key in the formula or cell reference.

  2. 2

    Point lookup_array at the column or row holding keys.

  3. 3

    Point return_array at values to fetch when a key matches.

  4. 4

    Set if_not_found to a friendly message instead of #N/A.

  5. 5

    Choose search_mode for exact or next-smaller approximate matches.

  6. 6

    Use one XLOOKUP per row or MAP/BYROW for column-wide fills.

Examples in Google Sheets

Price by SKU

=XLOOKUP(A2, Products!A:A, Products!C:C, "Missing", 0) returns unit price or a clear label.

Left lookup

=XLOOKUP(E2, Codes!B:B, Codes!A:A) fetches an ID from a code column to the right of names.

Tier rate

=XLOOKUP(D2, Tiers!A:A, Tiers!B:B, , -1) approximate match picks the correct bracket rate.

Build this without starting from a blank cell

Use a Better Sheets tool for XLOOKUP, then watch a walkthrough when you want the full pattern.

Better Sheets resources

Common mistakes

  • Lookup and return arrays different lengths causing errors.
  • Exact match mode on numbers stored as text keys.
  • Duplicate keys returning only the first match without warning.
  • Replacing VLOOKUP without fixing column index documentation.
  • Omitting if_not_found so reports show ugly #N/A to clients.

Frequently asked questions

XLOOKUP vs VLOOKUP?
XLOOKUP searches any direction and has clearer not-found handling.
XLOOKUP vs INDEX MATCH?
XLOOKUP combines both in one function with optional search modes.
Multiple results for one key?
XLOOKUP returns first match. FILTER for all matches.
XLOOKUP approximate match?
Use search_mode -1 or 1 per documentation for sorted approximate lookups.
XLOOKUP on rows?
Yes with horizontal lookup and return arrays.
Wildcards in XLOOKUP?
Use exact mode and prepare keys, or REGEXMATCH workflows for patterns.
XLOOKUP array spill?
Pass array of search keys to return a spilled column of results.

Related Tutorials

Watch how XLOOKUP works

Browse more tutorials
How do I reference a different spreadsheet in Apps Script?

How do I reference a different spreadsheet in Apps Script?

I'll show you how to get text from one spreadsheet file to another with ...
Use Index Match when you want Vlookup

Use Index Match when you want Vlookup

If you find Vlookup a difficult formula to understand, this formula comb...
Search Every Function in Google Sheets

Search Every Function in Google Sheets

Built a useful tool to filter Google Sheet formulas based on keywords.

Related blog posts

Guides that explain XLOOKUP in more depth.

Browse the blog

Related glossary terms

Done reading about XLOOKUP?

Membership unlocks 636+ tutorials, unlimited generators, and every template. Practical lessons. Zero fluff.

Need this once

Jump to a free tool or a single tutorial for this topic.

Learning Sheets for real

Unlock the full library, generators, and templates with membership.