VLOOKUP vs XLOOKUP vs just diffing two files
VLOOKUP is the most-Googled spreadsheet function for a reason — it solves a real problem: pull a value from a reference table based on a key in the current sheet. XLOOKUP, introduced in Office 365, fixes the original's worst quirks. Both are useful. Both are also constantly recommended for a job they were never built to do: comparing two files end-to-end and acting on the differences.
This post is a short guide to which approach actually fits which task.
What VLOOKUP is actually for
VLOOKUP looks up one value in the leftmost column of a range and returns a value from a column to the right. The signature is =VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]). You point it at the cell with the key, the reference table, the column you want back, and whether you want an exact or approximate match.
It is built into a live spreadsheet model: when the reference table changes, the lookup recomputes automatically. It is the right tool when you have a workbook with two sheets, one is the data and one is the lookup table, and the user expects the second sheet's values to update as the first changes.
What XLOOKUP fixes
XLOOKUP improves four things at once: lookup column does not have to be leftmost, you can return a whole row or column instead of a single cell, missing values can be defaulted in the formula itself instead of wrapping with IFERROR, and the binary-search 'approximate match' option is replaced with explicit match modes. The signature is =XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode]).
If you are choosing between VLOOKUP and XLOOKUP for a live spreadsheet, use XLOOKUP. It is strictly better. The catch is it ships only with Office 365 / Excel 2021+, so shared workbooks that need to open in older Excel still use VLOOKUP or INDEX/MATCH.
Where both of them are the wrong tool
The trap is using either as a 'compare two files' workflow. The pattern goes like this: paste both files into one workbook, write a VLOOKUP column from A into B, write another from B into A, then use conditional formatting to highlight the cells where VLOOKUP returned #N/A. It works for small files. It falls apart for any of these reasons:
- The files have more than a few thousand rows. The formulas recalculate on every edit and Excel slows to a crawl.
- One file has trailing spaces or different casing in the key column. Every row reports as a miss because
"JOSE "≠"jose". You have to wrap withTRIMandLOWERin both arrays and then everything is recomputed in a wrapper function. Goodbye performance. - You need to know not only what is missing but also what changed — same key, different values elsewhere. VLOOKUP cannot tell you which column changed; you have to write one formula per column you care about.
- You need to know what is duplicated inside each file. Neither function gives you that — you have to build a separate COUNTIFS column.
- You want to act on the result — export the missing rows, send them to someone, push them back into a CRM. With VLOOKUP the result is a colour-coded spreadsheet, not a list of rows you can pipe somewhere.
When a real diff is the right tool
If the question is 'I have two exports and I need to know what is different between them', the answer is a diff, not a lookup. A proper file diff:
- Returns four sets in one pass — only in A, only in B, in both, duplicated — instead of forcing you to build them manually.
- Normalises values before comparing (trim, case, accents), so 'JOSE ' = 'jose' = 'José' is one match instead of three rows highlighted red.
- Tells you which column changed for rows present in both files, not just whether the row exists.
- Exports each result set as a separate file you can act on.
- Scales past the row count where VLOOKUP starts blocking the UI.
This is what the Compare Excel files tool does. You drop two XLSX files, pick a key column if you want, enable the cleaning rules and click compare. The output is structured — rows only in A, rows only in B, duplicates, changed rows, almost-matches — and every section has an export button.
Quick decision table
- Live spreadsheet, lookup table that changes: XLOOKUP (or VLOOKUP for older Excel).
- One-off compare of two files: a diff tool.
- One-off compare with messy formatting: a diff tool with cleaning rules. VLOOKUP will lie to you.
- Need to know what changed inside matched rows: a diff tool. VLOOKUP cannot answer this without one formula per column.
- Need to export the differences: a diff tool.
None of this is a criticism of VLOOKUP. It is a great function for the job it was built for. It is also routinely misapplied, and the resulting workflow is slower, less accurate and less reusable than just diffing the files.