Excel XLOOKUP function: 6 arguments, examples, Google Sheets

XLOOKUP looks left or right and matches exactly by default. The 6 arguments, approximate match, bottom-up search, Excel versions and Google Sheets.

Adam Wang
27/10/2026 · 6 min read
Excel XLOOKUP function: 6 arguments, examples, Google Sheets
In this article (8)
  1. The XLOOKUP function has 6 arguments, and only the first 3 are required
  2. Unlike VLOOKUP, XLOOKUP can look left and needs no column number
  3. Set if_not_found to show your own text instead of #N/A
  4. Approximate match with match_mode 1 or -1 fits tiered tables like tax brackets
  5. Search from the bottom up with search_mode -1 to get the last match
  6. Which versions of Excel have the XLOOKUP function?
  7. XLOOKUP in Google Sheets uses the same 6 inputs with different names
  8. Four common XLOOKUP mistakes

The XLOOKUP function finds a value in one column and returns the data in the same row from another column, whether that column sits to the left or to the right. It returns an exact match by default.

The XLOOKUP function has 6 arguments, and only the first 3 are required

Microsoft's XLOOKUP function page, read on Oct 12, 2026, gives the syntax as =XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode]). The three arguments in square brackets are optional.

  1. lookup_value: what you want to find, such as a product code.
  2. lookup_array: the array or range to search.
  3. return_array: the array or range to return.
  4. if_not_found: the text to return when no valid match is found. Leave it out and you get #N/A.
  5. match_mode: 0 is an exact match and the default. -1 returns the next smaller item, 1 the next larger item, and 2 is a wildcard match where *, ? and ~ have special meaning.
  6. search_mode: 1 searches from the first item and is the default. -1 searches in reverse from the last item. 2 and -2 are binary searches that need data sorted in ascending or descending order.
Argument table of the XLOOKUP function on Microsoft Support, with every match_mode and search_mode value
The six arguments with every match_mode and search_mode value. Screenshot: Microsoft Support, Oct 12, 2026.

Unlike VLOOKUP, XLOOKUP can look left and needs no column number

Microsoft describes XLOOKUP as looking in one column and returning a result from the same row in another column, regardless of which side the return column is on. The VLOOKUP page, by contrast, tells you to organize data so the lookup value is to the left of the return value.

In this sample table in A1:C4, the product code sits in column C, to the right of the product name. The numbers are only for illustration.

A (Product)B (Price, USD)C (Code)
2A5 notebook1.40VP01
3Blue ballpoint pen0.25VP02
4Box of staples0.50VP03

Type VP02 in cell F2, then enter =XLOOKUP(F2,C2:C4,A2:A4) in G2. The function finds VP02 in column C and returns "Blue ballpoint pen" from column A.

The note under Example 1 on the Microsoft page names the main difference: XLOOKUP uses a lookup array and a return array, while VLOOKUP uses a single table array followed by a column index number. To find the dial code for Brazil, XLOOKUP uses =XLOOKUP(F2,B2:B11,D2:D11), and VLOOKUP needs =VLOOKUP(F2,B2:D11,3,FALSE).

XLOOKUP also matches exactly by default and can return several columns at once, as Example 2 returns both the employee name and department.

Example 1 on Microsoft Support: XLOOKUP returns the dial code for Brazil, with the equivalent VLOOKUP formula
Example 1 and the equivalent VLOOKUP formula. Screenshot: Microsoft Support, Oct 12, 2026.

Set if_not_found to show your own text instead of #N/A

If there is no valid match and the fourth argument is missing, XLOOKUP returns #N/A.

With the sample table above, =XLOOKUP(F2,C2:C4,A2:A4,"No such code") shows "No such code" when the code in F2 is not in column C. Example 3 on the Microsoft page does the same: ID 1234 is not in the employee table, so the result cell shows "ID not found" instead of an error.

Example 3 on Microsoft Support: XLOOKUP with an if_not_found argument shows text instead of an error when the employee ID is missing
ID 1234 is not in the table, so C2 shows ID not found instead of #N/A. Screenshot: Microsoft Support, Oct 12, 2026.

Approximate match with match_mode 1 or -1 fits tiered tables like tax brackets

To get the nearest level when there is no exact value, set match_mode to -1 for the next smaller item, or 1 for the next larger item.

Example 4 on the Microsoft page finds a tax rate for the income in cell E2 with =XLOOKUP(E2,C2:C7,B2:B7,0,1,1). The income does not match any level in column C exactly, so the function takes the next larger level and returns 24%.

This is also a left lookup, since the lookup column C sits to the right of the return column B.

Example 4 on Microsoft Support: XLOOKUP with match_mode 1 finds the tax rate for an income
A tax rate lookup with match_mode 1. Screenshot: Microsoft Support, Oct 12, 2026.

Search from the bottom up with search_mode -1 to get the last match

By default the function searches from top to bottom, so when a name appears on several rows, you get the first one. Set search_mode to -1 and it searches from the last entry to the first.

The example on Google's help page uses a sales table where Sarah appears on rows 6 and 7. =XLOOKUP("Sarah", E1:E7, D1:D7, "Missing",0,1) returns $43.20 from row 6. Change the last number to -1 and the result is $29.60 from row 7.

Example on Google Docs Editors Help: the same search for Sarah returns $43.20 with search_mode 1 and $29.60 with search_mode -1
The same search key gives two results with search_mode 1 and -1. Screenshot: Google Docs Editors Help, Oct 12, 2026.

Which versions of Excel have the XLOOKUP function?

The Applies To list on the Microsoft page includes Excel for Microsoft 365, Excel 2024 and Excel 2021, on Windows and Mac, plus Excel for iPad, iPhone, and Android tablets and phones. The list also shows Excel 2016 and 2019.

However, the note at the top of the page says XLOOKUP is not available in Excel 2016 and Excel 2019. You may still come across a workbook with XLOOKUP in those versions if someone else created it in a newer version of Excel.

If the person you send the file to still uses Excel 2016 or 2019, VLOOKUP is the safer choice.

Intro and note on Microsoft Support: XLOOKUP is not available in Excel 2016 and Excel 2019
The version note at the top of the page. Screenshot: Microsoft Support, Oct 12, 2026.

XLOOKUP in Google Sheets uses the same 6 inputs with different names

Google Sheets also has an XLOOKUP function. Its syntax is XLOOKUP(search_key, lookup_range, result_range, missing_value, match_mode, search_mode).

The six inputs map to the Excel arguments. missing_value is #N/A by default, match_mode is 0 by default and search_mode is 1 by default. Google adds two rules: lookup_range must be a single row or column, and result_range should have the same row or column size as lookup_range. If result_range is more than one row or column, the output is the entire row or column at the matched position.

Syntax of the XLOOKUP function in Google Sheets with each input and its default value
The six inputs and their defaults in Google Sheets. Screenshot: Google Docs Editors Help, Oct 12, 2026.

Four common XLOOKUP mistakes

  • The recipient uses Excel 2016 or 2019, where XLOOKUP is not available.
  • Forgetting match_mode when you need an approximate match, so a value without an exact match returns #N/A.
  • Using search_mode 2 or -2 on unsorted data, which returns invalid results.
  • Mismatched range sizes in Google Sheets.

If you rebuild the same lookup table every week, that repeat task can be packaged as a skill. The explainer What is a Claude skill shows how, and the news page has more step-by-step guides. Which part trips you up most: looking left, #N/A, or picking the wrong match mode?

Related guides: AI for office work.

Sources, accessed Oct 12, 2026:

Linh SEO Agent

Related guide: AI for Excel: Copilot, Claude for Excel and Gemini in Sheets

The complete guide for this topic: AI Tools for Office Work: 10 Tasks You Can Do Faster

Found it useful? Share it:
Facebook

More reading

Latest news

The ten most recent, scrolling sideways. Hover or tap to pause.