XLOOKUP vs LOOKUP: Key Differences Explained

Formulas & functions · Updated November 22, 2026

The main difference between XLOOKUP and LOOKUP is that XLOOKUP searches for a value in one column or row and returns a matching value from any other column or row, while LOOKUP (the older function) has a more limited, sometimes unpredictable behavior: it can perform a vector or array lookup, but it does not support exact-match by default and can return incorrect results if the lookup range is not sorted. XLOOKUP is the modern replacement, available in Excel 2021 and Microsoft 365, offering exact match, reverse search, and error handling.

Background: Why Two Functions Exist

LOOKUP is one of Excel’s oldest functions, dating back to the earliest spreadsheet versions. It was designed for simple lookups in sorted data, and it works in two forms: vector (searches one row or column) and array (searches a rectangular range). However, LOOKUP has a notorious quirk: if it cannot find an exact match, it returns the largest value that is less than or equal to the lookup value, assuming the data is sorted. If the data isn’t sorted, the results are unpredictable.

XLOOKUP was introduced in 2020 as part of Microsoft 365 and Excel 2021. It was designed to replace not only LOOKUP but also VLOOKUP and HLOOKUP, addressing their limitations: it supports exact match by default, searches from the bottom up, returns multiple matches, and allows you to specify a value to return if no match is found.

How LOOKUP Works

LOOKUP has two syntax forms:

  • Vector form: =LOOKUP(lookup_value, lookup_vector, [result_vector]) – searches for lookup_value in lookup_vector (a single row or column) and returns the value from the same position in result_vector. If result_vector is omitted, it returns the value from lookup_vector.
  • Array form: =LOOKUP(lookup_value, array) – searches the first row or column of the array and returns the last row or column value. This form is rarely used and can be confusing.

Example: With names in A2:A5 and scores in B2:B5, =LOOKUP("Charlie", A2:A5, B2:B5) returns Charlie’s score. But if “Charlie” isn’t in the list, LOOKUP returns the score of the last name that is alphabetically less than “Charlie” – which may not be what you want.

How XLOOKUP Works

XLOOKUP syntax is: =XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])

  • lookup_value: what you’re searching for.
  • lookup_array: the range to search.
  • return_array: the range to return a value from.
  • if_not_found: optional text or value to return if no match (e.g., “Not found”).
  • match_mode: 0 for exact match (default), -1 for exact or next smaller, 1 for exact or next larger, 2 for wildcard match.
  • search_mode: 1 for search from first, -1 for search from last, 2 for binary search (sorted), -2 for binary search (sorted, reverse).

Example: With names in A2:A5 and scores in B2:B5, =XLOOKUP("Charlie", A2:A5, B2:B5, "Not found") returns Charlie’s score, or “Not found” if Charlie isn’t there. Unlike LOOKUP, it doesn’t assume sorting and returns an exact match by default.

Key Differences at a Glance

Feature LOOKUP XLOOKUP
Exact match by default No (approximate match only) Yes
Requires sorted data Yes for reliable results No
Search direction First to last only First to last or last to first
Return value if not found Error #N/A Custom message or value
Works with columns and rows Yes, but limited Yes, both directions
Can return multiple values No Yes (with array formulas)
Available in All Excel versions Excel 2021 and Microsoft 365

When to Use Which

Use LOOKUP only if you’re working with an older Excel version that doesn’t support XLOOKUP, or if you need a quick approximate match on sorted data and don’t need error handling. It’s also useful for backward compatibility in shared workbooks.

Use XLOOKUP whenever possible because it’s more robust, easier to read, and less error-prone. It’s the recommended function for any new spreadsheet. For example, if you have a product list with product IDs in column A and prices in column B, and you want to look up a price by ID, XLOOKUP is the clear choice:

With product IDs in A2:A100 and prices in B2:B100, =XLOOKUP("P123", A2:A100, B2:B100, "Price not found") returns the price for P123, or a friendly message if it doesn’t exist.

Common Problems and Misconceptions

Misconception 1: LOOKUP is the same as VLOOKUP. They’re different. VLOOKUP searches a column to the right of the lookup column, while LOOKUP can return from any vector, but it doesn’t have the exact-match default. XLOOKUP replaces both.

Misconception 2: XLOOKUP works in all Excel versions. It does not. It requires Excel 2021 or Microsoft 365. If you share a workbook with someone using Excel 2019 or earlier, they’ll get a #NAME? error.

Common problem with LOOKUP: Unsorted data gives wrong results. For example, if you have scores in A2:A5 (70, 85, 90, 75) and names in B2:B5, and you use =LOOKUP(80, A2:A5, B2:B5) without sorting, LOOKUP may return the name associated with 75 (the largest value less than 80) but it might also return an arbitrary value if the data isn’t sorted correctly. The function assumes the lookup vector is sorted ascending; if not, results are unreliable.

Common problem with XLOOKUP: Forgetting the if_not_found argument can lead to #N/A errors, but that’s actually a feature – you can control the message.

Alternatives and Related Functions

Besides XLOOKUP and LOOKUP, Excel offers other lookup functions:

  • VLOOKUP – searches for a value in the first column of a table and returns a value in the same row from a specified column. Requires sorted data for approximate match, but with FALSE it does exact match.
  • HLOOKUP – same as VLOOKUP but searches rows instead of columns.
  • INDEX/MATCH – a powerful combination that works in all Excel versions and can do left lookups (returning a value from a column to the left of the lookup column).
  • XMATCH – the modern counterpart to MATCH, often used with INDEX for more flexibility.

For most new work, XLOOKUP is the best choice because it’s simpler and more powerful. But if you need to support old Excel versions, INDEX/MATCH is a reliable alternative that doesn’t require sorting.

Frequently Asked Questions

Can LOOKUP return an exact match?

No, LOOKUP doesn’t have an exact-match option. It always does an approximate match, returning the largest value less than or equal to the lookup value. To get an exact match, you’d need to use VLOOKUP with FALSE, or better, XLOOKUP.

Is XLOOKUP faster than LOOKUP?

In most cases, XLOOKUP is faster because it uses a more efficient search algorithm, especially on large datasets. However, for very small datasets, the difference is negligible. The main speed benefit comes from not having to sort data and from using binary search mode when data is sorted.

Why does my LOOKUP return #N/A?

LOOKUP returns #N/A if the lookup value is smaller than the smallest value in the lookup vector. For example, if your lookup vector contains numbers 10, 20, 30 and you search for 5, LOOKUP returns #N/A because there’s no value less than or equal to 5.

Can XLOOKUP return multiple matches?

Yes, XLOOKUP can return multiple matches when used with dynamic arrays. For example, =XLOOKUP("Apple", A2:A10, B2:B10) returns only the first match, but if you use =FILTER(B2:B10, A2:A10="Apple") you get all matches. XLOOKUP itself returns a single value, but you can combine it with array functions.

Is LOOKUP still useful in modern Excel?

Only for compatibility with old spreadsheets or if you’re working with a legacy file that uses it. For any new formula, XLOOKUP is recommended because it’s more reliable and flexible. However, if you’re using Excel 2016 or earlier, LOOKUP might be your only option for certain lookups, but consider using INDEX/MATCH instead.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.