ShareYourGroupShareYourGroupExcel Formulas

Guides

VLOOKUP or XLOOKUP: which should you use?

Excel now has two main lookup functions. VLOOKUP has been in every version for decades. XLOOKUP arrived with Excel 2021 and Microsoft 365 and was designed to fix VLOOKUP's weak points. This page puts them side by side on the same data, so that you can choose with your eyes open.

Sample sheet: A small price list with item codes. The table is sorted by code.
ABCDE
1CodeItemCategoryPriceStock
2A101Basmati Rice 5 kgGrocery65040
3A102Toor Dal 1 kgGrocery16075
4B201NotebookStationery60300
5B202Ball PenStationery100
6C301LED BulbElectronics110200
7C302Power BankElectronics129918
8D401Steel BottleHome45055

The same lookup, both ways

Find the price of the item with code C302.

VLOOKUP is given the whole table and a column number. XLOOKUP is given the column to search and the column to answer from.

Differences at a glance

VLOOKUPXLOOKUP
Default matchapproximate, unless you type FALSEexact
Directionanswer must be to the rightany direction
What you give itwhole table and a column numbersearch range and answer range
Inserting a columncan break the formulano effect
Value not found#N/A, needs IFERROR or IFNAbuilt-in "not found" argument
Last matchnot possiblesearch from the end
Several columns backone at a timeseveral at once
Wildcardsalways on with exact matchon request, match mode 2
VersionsallExcel 2021, Microsoft 365

The default match

Leave off VLOOKUP's last argument and it does an approximate match. On an unsorted table that returns wrong answers without any warning. It is the best-known trap in Excel.

This table happens to be sorted by code, so the first formula is right. The second asks for B205, a code that does not exist, and VLOOKUP quietly returns the item for the nearest code below it. XLOOKUP, asked the same, reports that the code is missing.

Looking to the left

Find the code of the Notebook. The answer is to the left of the column being searched.

VLOOKUP cannot do this at all. Before XLOOKUP, the answer was INDEX and MATCH, shown in the second formula, which still works everywhere.

A value that is not found

Both give a message. XLOOKUP needs no wrapper.

Several answers at once

To bring back the item, category and price for a code, VLOOKUP needs three formulas with three column numbers. XLOOKUP takes a wider answer range and spills the results across.

Bands and nearest matches

VLOOKUP's approximate mode needs the table sorted in rising order. XLOOKUP's match mode -1 (next smaller) and 1 (next larger) work on a table in any order.

Sample sheet: A marks table and a grade table. The grade table lists the lowest mark of each grade, in rising order.
ABCDE
1NameMarksFromGrade
2Asha910E
3Ravi4533D
4Meena7950C
5Kabir2865B
6Tara6580A

The last match

In a log kept in date order, the latest entry for a person is the last one. XLOOKUP can search from the bottom.

Sample sheet: Twelve sales made by four salespeople in three regions.
ABCDEF
1DateSalespersonRegionProductUnitsAmount
205-Jan-2026AshaNorthNotebook201200
312-Jan-2026RaviSouthPen50500
420-Jan-2026MeenaNorthBag43000
502-Feb-2026AshaEastPen30300
614-Feb-2026KabirSouthNotebook15900
728-Feb-2026RaviNorthBag21500
803-Mar-2026MeenaEastNotebook402400
915-Mar-2026AshaNorthBag32250
1022-Mar-2026KabirSouthPen60600
1101-Apr-2026RaviEastNotebook251500
1218-Apr-2026MeenaNorthPen80800
1306-May-2026AshaSouthBag53750

VLOOKUP finds Asha's first sale. XLOOKUP, with its last argument set to -1, finds her most recent one.

So which should you use?

Use XLOOKUP when everyone who will open the workbook has Excel 2021 or Microsoft 365. It is safer by default, shorter and more capable.

Use VLOOKUP or INDEX and MATCH when the file may be opened in Excel 2019, 2016 or earlier. There, an XLOOKUP formula shows #NAME?, and the person receiving the file cannot fix it without rewriting it. In offices with mixed versions this is the deciding point. Check which versions your colleagues, clients and accountant use before changing over.

Keep reading VLOOKUP either way. Millions of existing workbooks use it, and you will meet it for years.

Turning a VLOOKUP into an XLOOKUP

Take =VLOOKUP(G2, $A$2:$E$8, 4, FALSE).

  1. The lookup value stays: G2.
  2. The search range is the first column of the old table: $A$2:$A$8.
  3. The answer range is the column that the number pointed to. Column 4 of a table starting at A is column D: $D$2:$D$8.
  4. Drop the FALSE. Exact match is the default.

Result: =XLOOKUP(G2, $A$2:$A$8, $D$2:$D$8).

If the old formula ended in TRUE or had no fourth argument, it was an approximate match. Add match mode -1: =XLOOKUP(G2, $A$2:$A$8, $D$2:$D$8, , -1).

Habits that help with both

Every result on this page was calculated in Microsoft Excel (version 16.0, build 20326) on 12 November 2026, not typed by hand.

This is an independent help site. It is not connected with or approved by Microsoft. Excel and Microsoft 365 are trademarks of Microsoft Corporation, named here only to say which program a formula is for. The people and figures in the sample sheets are made up.