VLOOKUP vs XLOOKUP, Which Should You Use?
Use XLOOKUP when your Excel version supports it and you want exact matching by default or a result column on either side. Keep VLOOKUP for compatible existing formulas or workbooks that must work in Excel 2016 or 2019, where XLOOKUP is unavailable. XLOOKUP takes two separate ranges, so the result column can sit left of the search column, which VLOOKUP cannot do.
On this page▾
What each function actually needs
VLOOKUP's syntax, per Microsoft's documentation, is:
VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
You give it one value to search for, a block of cells to search in, and a column number (counted from the left edge of that block) to pull the result from. The function only searches the first (leftmost) column of your range and returns a value from the selected column of that range. A column index of 1 refers to the search column itself; it cannot return a column to the left of the range.
XLOOKUP's syntax is:
XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
Instead of one block of cells and a column number, you point to two separate ranges: the one you're searching in, and the one you want results from. Microsoft's documentation states this directly: "XLOOKUP uses a lookup array and a return array, whereas VLOOKUP uses a single table array followed by a column index number." Because the two ranges are separate, the return range does not have to be to the right of the lookup range. It can be to the left.
A worked example
Take this small product table:
| Column | A: Product | B: Price | C: Category |
|---|---|---|---|
| Row 4 | Apple | 1.50 | Fruit |
| Row 5 | Bread | 3.20 | Bakery |
| Row 6 | Cheese | 5.75 | Dairy |
Finding the price of "Cheese" with VLOOKUP:
=VLOOKUP("Cheese", A4:C6, 2, FALSE)
This returns 5.75. The 2 means "the second column of A4:C6," which is column B (Price). The FALSE tells VLOOKUP to require an exact match. If you omit this argument, VLOOKUP defaults to approximate matching. Microsoft says the first column must be sorted for that mode; otherwise, an unexpected value can be returned. Use FALSE when an exact product name is required, rather than treating it as a rule for every lookup.
The same lookup with XLOOKUP:
=XLOOKUP("Cheese", A4:A6, B4:B6)
This also returns 5.75. Notice the structure is different: you point directly to the Product column (A4:A6) as the search range and directly to the Price column (B4:B6) as the return range, instead of giving a column number inside a combined block.
Now rearrange the columns to A: Category, B: Price, C: Product. VLOOKUP cannot look up a Product and return a Price in that case if Product is the rightmost column and Price is to its left, because VLOOKUP can only return values to the right of its search column. XLOOKUP has no such restriction, since its two ranges are independent: =XLOOKUP("Cheese", C4:C6, B4:B6) works regardless of which range is physically left or right of the other on the sheet.
Match modes and missing values
Microsoft's VLOOKUP documentation separates these cases:
- Exact match with no match: With FALSE, VLOOKUP returns #N/A if the requested value is absent.
- Approximate match: With TRUE or an omitted final argument, the first column must be sorted. Unsorted data can produce an unexpected result. If the lookup value is smaller than the smallest value in that first column, VLOOKUP returns #N/A.
- Unclean text: Leading or trailing spaces and nonprinting characters can cause unexpected results. Check the source values rather than assuming that two labels that look alike are identical.
XLOOKUP defaults to exact matching: its optional match_mode is already 0. You do not need to supply 0 to make the three-argument Cheese example exact. If nothing matches and you omit if_not_found, XLOOKUP still returns #N/A. To provide a message explicitly, use =XLOOKUP("Cheese", A4:A6, B4:B6, "Not found"). Cheese exists here, so that formula still returns 5.75; the message applies only when a valid match is absent.
XLOOKUP searches from the first item by default. Its search_mode of -1 searches from the last item instead. This lets you choose the search direction when keys repeat; it does not combine all matching rows into a total. Its approximate modes are optional too: match_mode -1 chooses the next smaller item if there is no exact match, and 1 chooses the next larger item.
Hiding #N/A from a failed lookup is covered in IFERROR vs IFNA, Which Errors Should You Hide?.
When VLOOKUP is still fine to use
Microsoft states that XLOOKUP is not available in Excel 2016 or Excel 2019. VLOOKUP is an available alternative when your layout fits its left-to-right restriction. Before replacing formulas in a shared workbook, check the Excel versions recipients use. Choosing a supported lookup function addresses that function's compatibility, not every possible compatibility issue in the workbook.
A simple rule for choosing
- Use VLOOKUP for Excel 2016/2019 compatibility when the search key is in the first column of your table range and the result is to its right. A left-to-right layout alone does not require VLOOKUP.
- Use XLOOKUP in a supported Excel version when you want separate search and return ranges, exact matching by default, or an explicit if_not_found message.
Sources
About this guide
Howlane operator · Checked against the official sources listed above. It is general information, not professional advice.
AboutEditorial standardsCorrectionsReport an error
Edit history
- Updated
- Updated
- Updated
- Updated
- Published