In Excel, what does XLOOKUP do that VLOOKUP cannot?
answer
- one takes a range, the other takes two
- count columns versus name a column
- check what the omitted argument defaults to
- which one can look leftward
- exact match is not the older default
basics
~20 sXLOOKUP takes a separate lookup array and return array, so it can return values to the left of the key, defaults to exact match, and accepts a built-in not-found value. VLOOKUP scans only the first column and returns by column number.
solid answer
~50 s`VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])` searches the **first column** of the range and returns a value from a column counted rightward by position. Two things bite: the fourth argument defaults to **TRUE (approximate match)** when omitted, and `col_index_num` is a hardcoded number that silently points at the wrong column the moment someone inserts a column inside the range. `XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])` names the searched range and the returned range independently, so the returned column can sit anywhere — including to the left of the key — and it defaults to **exact match**. It also takes an `if_not_found` argument instead of forcing an `IFERROR` wrapper, and the return array can be several columns wide so one formula spills a whole row. XLOOKUP needs Microsoft 365 or Excel 2021 and later; older workbooks use `INDEX`/`MATCH` with `match_type` 0.
code
text · 5 lines-- returns column D of B:F, by position
=VLOOKUP(A2, Products!B:F, 3, FALSE)
-- names the two ranges; no index to invalidate
=XLOOKUP(A2, Products!$B:$B, Products!$D:$D, "not found")go deeper
Be ready to write both formulas from memory and state that VLOOKUP's fourth argument must be FALSE for an exact match. Knowing XLOOKUP can return columns to the left of the key is the expected headline.
Explain why a hardcoded column index is a silent bug: an inserted column keeps the formula valid but changes the answer. Contrast if_not_found with a blanket IFERROR wrapper.
Show you have debugged a workbook where an approximate-match lookup quietly returned near-misses for months. Talk about standardising on structured Table references so lookups survive edits by other people.
Own the question of whether lookup logic belongs in cells at all: repeated key joins across worksheets are a modelling smell that belongs in a relationship or a query, not in a formula copied down 40,000 rows.
## The two signatures `VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])` takes one rectangular range, searches its **leftmost column** for the lookup value, and returns whatever sits in the *n*-th column of that same range, counting rightward from that leftmost column. `XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])` takes the searched range and the returned range as two independent arguments. Nothing ties them together except that they should be the same length. That one structural difference produces most of the practical ones. ## Direction, and the fragile column index Because VLOOKUP counts columns rightward from the key, it cannot return anything to the left of the key. The traditional workarounds are rearranging the source columns (often impossible — it is someone else's export) or `INDEX`/`MATCH`. Worse, `col_index_num` is a **position, not a reference**. `=VLOOKUP(A2, Products!B:F, 3, FALSE)` means "the third column of B:F", i.e. column D. Insert a new column between B and D and the formula still says 3 — it now returns the inserted column. Excel does not flag this: the formula is valid, the result is a plausible-looking value, and the error surfaces weeks later as a wrong number. XLOOKUP has no index; its return range is an ordinary reference that Excel adjusts when columns move. ## Match defaults Omitting VLOOKUP's fourth argument gives **approximate match**, which assumes the first column is sorted ascending and returns the largest value less than or equal to the lookup value. On unsorted text this returns essentially arbitrary matches rather than an error, which is why `FALSE` (or `0`) is nearly always the right fourth argument and why omitting it is a classic silent bug. XLOOKUP's `match_mode` defaults to `0`, exact match. The other modes are explicit: `-1` exact or next smaller, `1` exact or next larger, `2` wildcard. `search_mode` defaults to `1` (first to last); `-1` searches last to first, which is the clean way to grab the most recent record in an append-only sheet; `2` and `-2` request a binary search on data you promise is sorted. ## Not-found handling A VLOOKUP miss returns `#N/A`, and the usual response is `IFERROR(VLOOKUP(...), "")`. That works, but `IFERROR` swallows **every** error: a `#REF!` from a deleted column and a `#VALUE!` from a bad argument disappear along with the legitimate misses, so a broken formula looks like a clean blank. XLOOKUP's fourth argument, `if_not_found`, fires only for the not-found case and leaves real errors visible. ## Returning more than one column `return_array` may be several columns wide. `=XLOOKUP(A2, Products[SKU], Products[[Name]:[Price]])` returns the whole slice and spills it across adjacent cells, replacing three separately maintained VLOOKUPs that each had their own column index to get wrong. ## Availability and fallbacks XLOOKUP requires Microsoft 365 or Excel 2021 and later (and Excel for the web). If a workbook must open in Excel 2016 or 2019, it will show `#NAME?`. The portable equivalent is `INDEX`/`MATCH`: ``` =INDEX(Products!$A:$A, MATCH(F2, Products!$C:$C, 0)) ``` `MATCH` returns a row position, `INDEX` fetches from any column using it, so this also looks leftward. Note that `MATCH`'s third argument has the same trap as VLOOKUP's fourth — omit it and you get approximate matching — so always pass `0`. ## What interviewers are checking The question is rarely about memorising an argument list. It is whether you know **which lookup failures are silent**: approximate match on unsorted data, a column index invalidated by an insert, and errors hidden by a blanket `IFERROR`. A candidate who names those three has demonstrated they have debugged a wrong spreadsheet number, which is the actual skill on offer.
- What do XLOOKUP's match_mode and search_mode arguments control?`match_mode` picks the matching rule: `0` exact (the default), `-1` exact or next smaller, `1` exact or next larger, `2` wildcard. `search_mode` picks the direction: `1` first-to-last (default), `-1` last-to-first — handy for pulling the most recent row from an append-only sheet — and `2`/`-2` for a binary search on data you guarantee is sorted.
- Why prefer XLOOKUP's if_not_found argument over wrapping the formula in IFERROR?`IFERROR` catches every error type, so a `#REF!` from a deleted column or a `#VALUE!` from a bad argument is hidden behind the same blank as a legitimate miss. `if_not_found` fires only when the lookup value is absent, leaving structural errors visible so you find out the formula is broken rather than reading its blank as "no match".
- The workbook must open in Excel 2019 — how do you write it?Use `INDEX`/`MATCH`: `=INDEX(return_column, MATCH(key, key_column, 0))`. It looks in any direction and survives column inserts because both arguments are real references. Pass `0` explicitly as `MATCH`'s third argument — omitted, it defaults to approximate matching on supposedly sorted data, the same silent failure as VLOOKUP's omitted fourth argument.
saying these in an interview costs you the question
- Says VLOOKUP defaults to exact match when the last argument is omitted
- Hardcodes col_index_num and is surprised an inserted column breaks it
- Wraps every lookup in IFERROR, hiding #REF! and #VALUE! too
- Assumes XLOOKUP exists in every Excel version, including 2016
- Thinks XLOOKUP requires the lookup array to be sorted