Excel

XLOOKUP vs VLOOKUP: Which Should You Use in Excel?

A practical comparison of XLOOKUP and VLOOKUP for everyday office reports, with formulas you can copy and a simple rule for choosing between them.

  • By Axis Skill Academy
  • 5 min read
Excel worksheet comparing XLOOKUP and VLOOKUP formulas
Quick answer

If your team uses Microsoft 365 or Excel 2021 and later, use XLOOKUP. It matches exactly by default, can look left, and does not break when someone inserts a column. Keep VLOOKUP (or INDEX and MATCH) only for files that must open in Excel 2019 or older.

Key takeaways

  • VLOOKUP uses approximate match unless you type FALSE as the last argument, which is the most common cause of wrong results.
  • XLOOKUP looks up exact matches by default and lets you set your own “not found” message.
  • XLOOKUP can return values from columns to the left of the lookup column, which VLOOKUP cannot do.
  • XLOOKUP shows #NAME? in Excel 2019 and older, so check who will open the file before you switch.

Almost every office report in Malaysia has a lookup somewhere: matching staff IDs to departments for a claims summary, invoice numbers to customer names, or product codes to prices. For years the answer was VLOOKUP. Today most companies on Microsoft 365 also have XLOOKUP, and the question we hear in almost every Excel class is simple: which one should I use?

This guide compares the two side by side with formulas you can copy, so you can decide in a few minutes.

01How VLOOKUP works, and where it goes wrong

VLOOKUP searches the first column of a range and returns a value from a column number you specify:

=VLOOKUP(A2, Staff!A:D, 3, FALSE)

In plain words: find the staff ID in A2 inside column A of the Staff sheet, then return whatever is in the third column of that range. It works, but it has three weak spots that cause real reporting errors:

  • Approximate match by default. If you leave out the last argument, Excel assumes TRUE (approximate match). On unsorted data this quietly returns the wrong row instead of an error.
  • Hard-coded column number. The “3” does not move. If a colleague inserts a new column in the Staff sheet, your formula now returns the wrong column.
  • Right-only lookups. VLOOKUP can only return values to the right of the lookup column. If the staff ID sits in column D and the name is in column B, VLOOKUP cannot help without rearranging the data.

02How XLOOKUP works

XLOOKUP separates the column you search from the column you return:

=XLOOKUP(A2, Staff!A:A, Staff!C:C, "Not found")

The four parts are: what to find, where to look, what to return, and what to show if nothing matches. Two optional arguments give extra control:

  • match_mode: 0 for exact match (the default), -1 or 1 for the next smaller or larger item, and 2 for wildcard matches such as "*Sdn Bhd*".
  • search_mode: 1 to search from the top (the default) or -1 to search from the bottom, which is handy for finding the latest entry for a customer.

If your data is formatted as an Excel Table, the formula becomes even easier to read and keeps working as rows are added:

=XLOOKUP([@StaffID], Staff[StaffID], Staff[Department], "Not found")

03XLOOKUP vs VLOOKUP side by side

Feature VLOOKUP XLOOKUP
Default match Approximate (unless FALSE) Exact
Look to the left No Yes
Safe when columns are inserted No, column number is fixed Yes, return range moves with the data
Custom “not found” message Needs IFERROR or IFNA Built in
Search from the bottom No Yes (search_mode -1)
Return several columns at once One formula per column Yes, results spill across
Works in Excel 2019 and older Yes No (#NAME?)

04Three everyday examples

1. Look to the left

Your sales list has customer names in column B and invoice numbers in column E. To get the customer name for an invoice:

=XLOOKUP(H2, Sales!E:E, Sales!B:B, "Check invoice no.")

2. Return several columns in one go

To bring back department, grade and cost centre for a staff ID with one formula, select a return range that covers all three columns. The results spill into the cells to the right:

=XLOOKUP(A2, Staff[StaffID], Staff[[Department]:[CostCentre]])

3. Find the latest record

For a payment log sorted by date, the last match is the most recent payment. Search from the bottom:

=XLOOKUP(A2, Payments[Customer], Payments[Amount (RM)], 0, 0, -1)

05When VLOOKUP (or INDEX and MATCH) is still the right choice

XLOOKUP is not available in Excel 2016 or Excel 2019. If a client, auditor or another department still uses those versions, they will see #NAME? where your results should be. In that case, use INDEX and MATCH, which also looks left and survives inserted columns:

=INDEX(Staff!C:C, MATCH(A2, Staff!A:A, 0))

Tip: before you share a workbook outside your team, ask which Excel version the recipient uses. It takes ten seconds and avoids a confusing email thread later.

06How to switch your team over

  1. Check versions. Confirm everyone who edits the file is on Microsoft 365 or Excel 2021 and later.
  2. Convert data to Tables. Select the data and press Ctrl+T, then give each table a clear name such as Staff or Sales.
  3. Replace one report at a time. Rewrite the lookups in a copy of the file and compare totals with the old version before you retire it.
  4. Add a “not found” message. A clear message such as “Check staff ID” is easier to act on than #N/A.

07Frequently asked questions

Is XLOOKUP slower than VLOOKUP?

For typical office files with a few thousand rows, you will not notice a difference. Very large models benefit more from good structure, such as Tables and avoiding whole-column references, than from the choice of lookup function.

Does XLOOKUP work in Excel for the web and on Mac?

Yes. XLOOKUP is available in Excel for Microsoft 365 on PC and Mac, Excel 2021 and later, and Excel for the web.

Should I still learn VLOOKUP?

Yes, because you will keep meeting it in older files. Knowing how it works helps you fix those files and convert them to XLOOKUP with confidence.

Lookups are only one part of building a report that updates itself. In our Excel for Work course, participants practise XLOOKUP, Tables, PivotTables and clean-up techniques on realistic company data, at Basic, Intermediate or Advanced level.

Axis Skill Academy logo
Written byAxis Skill Academy

Practical Excel, Power BI and AI training for working teams in Malaysia, in public classes or in-house at your company.