Excel function

XLOOKUP in Excel: find matching values left or right

XLOOKUP finds a value in one range and returns a related value from another range. It is one of the clearest ways to connect two tables in modern Excel.

What XLOOKUP does

XLOOKUP searches for a lookup value inside a lookup array and returns the matching item from a return array. In plain language: find this ID, then give me the price, name, status, owner, or date on the same row.

Its basic syntax is `=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])`. The first three arguments are required. The optional arguments control what happens when no match is found, whether the match must be exact, and how Excel searches.

Use exact match for most everyday work. For example, `=XLOOKUP(A2,F:F,G:G,"Not found",0)` looks for the value in A2 inside column F and returns the related value from column G. The `0` means exact match. The custom `"Not found"` message is easier to understand than a raw `#N/A`.

Arguments explained

`lookup_value` is the thing you are searching for, such as a product code in A2. `lookup_array` is the range that contains possible matches, such as F:F. `return_array` is the range that contains the answer you want, such as G:G.

`if_not_found` is optional but helpful. It lets you return text like `"Missing"` instead of an error. `match_mode` controls exact or approximate behavior. Use `0` for exact match. Approximate options are useful for tiers and thresholds, but they should be chosen deliberately. `search_mode` controls search direction, including searching from last to first.

Unlike VLOOKUP, XLOOKUP can return values from columns to the left or right of the lookup column. If employee names are in column B and employee IDs are in column D, XLOOKUP can search D:D and return B:B without rearranging the table.

Practical examples

A beginner example is looking up an item price. If A2 contains SKU `BB20`, F:F contains SKU codes, and G:G contains prices, use `=XLOOKUP(A2,F:F,G:G,"Missing",0)`. Excel searches for A2 in F:F and returns the price from G:G on the matching row.

A business example is assigning account owners. Suppose column B contains customer IDs in a sales export, column J contains customer IDs in a reference table, and column K contains account owners. `=XLOOKUP(B2,J:J,K:K,"Unassigned",0)` returns the owner for that customer or clearly marks missing IDs.

When to use it

Use XLOOKUP when you need a clear exact match lookup, a custom missing-value message, or a lookup that returns data from either side of the lookup column. It is also useful when you want formulas that are easier to read than nested INDEX and MATCH formulas.

Do not use XLOOKUP for simple arithmetic, summaries by category, or cases where a PivotTable or SUMIFS answers the question more directly. Also remember that XLOOKUP is available in modern Excel; older workbooks may still rely on VLOOKUP, INDEX, and MATCH for compatibility.

Practical examples

Exact match with custom message

=XLOOKUP(A2,F:F,G:G,"Not found",0)

Looks for A2 in column F, returns the matching value from column G, and displays Not found if there is no exact match.

Lookup to the left

=XLOOKUP(D2,H:H,F:F,"Missing",0)

Finds the ID in D2 within column H and returns the related value from column F, even though F is to the left.

Recommended Excel functions

XLOOKUPVLOOKUPINDEXMATCHIFERROR

Common mistakes

  • 01Forgetting to use exact match behavior when IDs or codes must match exactly.
  • 02Using lookup and return arrays with different heights.
  • 03Returning a custom not-found value that hides a real data-quality problem.
  • 04Using XLOOKUP when SUMIFS or COUNTIFS would answer a summary question better.

Practice

Practice this skill with interactive exercises on Calcu.

Use Calcu to practice XLOOKUP in realistic spreadsheet exercises with instant feedback.

FAQ

What is XLOOKUP used for in Excel?

XLOOKUP is used to find a value in one range and return a related value from another range, such as finding a price, name, status, or owner.

Can XLOOKUP look to the left?

Yes. XLOOKUP can return values from a range to the left or right of the lookup range.

How do I make XLOOKUP exact match?

Use 0 as the match_mode argument, such as =XLOOKUP(A2,F:F,G:G,"Not found",0).