FormulaCamp
Completed
← Google Sheets functions
Google Sheets function

XLOOKUP in Google Sheets

XLOOKUP is built into Google Sheets, with the same argument order as the Excel version shown here.

Syntax (same in Google Sheets)

XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])

When the result range has several columns, the formula returns the whole matching row and spreads it across the neighbouring cells.

For a fuller explanation of the arguments and common errors, see the XLOOKUP Excel guide.

Worked examples in Google Sheets

Look up a price by SKU

ABCDEF
1SKUProductPriceLook upPrice
2A101Desk lamp24.99A103
3A102Monitor stand39
4A103USB hub18.5

Formula: F2: =XLOOKUP(E2,A2:A4,C2:C4)

Result: 18.5

Searches A2:A4 and returns the item in the same position of C2:C4. Exact match is the default.

Custom message when missing

ABCDE
1SKUPriceLook upPrice
2A10124.99Z999
3A10239

Formula: E2: =XLOOKUP(D2,A2:A3,B2:B3,"Not in catalog")

Result: Not in catalog

The fourth argument replaces #N/A with your own text.

Look left of the key

AB
1EmployeeID
2Maria Lopez1042
3James Cole1043
4Priya Shah1044

Formula: D2: =XLOOKUP(1043,B2:B4,A2:A4)

Result: James Cole

The return range (names) sits left of the search range (IDs). VLOOKUP cannot do this.

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in F2: =XLOOKUP(103,A2:A6,B2:B6,"none")

Example spreadsheet for XLOOKUP
ABCDEF
1IDItemPriceStockResult
2101Pen2.5120Lamp
3102Notebook480
4103Lamp2515
5104Mug7.540
6105Backpack3912
Result in F2: Lamp
Practice this in a lesson: XLOOKUP

Frequently asked questions

Is XLOOKUP available in Google Sheets?
Yes, it is a native function there. The lookup, return, not-found, match-mode and search-mode arguments follow the same order as in Excel.

Google Sheets is used here only as a descriptive product name. FormulaCamp is not affiliated with Google.