How do I use XLOOKUP in Excel?

XLOOKUP finds a value in one column or row and returns the matching item from another. The basic form is =XLOOKUP(what to find, where to look, what to return), and it looks for an exact match unless you tell it otherwise.

A first example

Say cells B2 to B11 hold country names, D2 to D11 hold their phone codes, and you type a country name in F2. In an empty cell, enter:

=XLOOKUP(F2, B2:B11, D2:D11)

  1. Type =XLOOKUP(.
  2. Select the cell holding the value you want to find (F2), then type a comma.
  3. Select the range to search (B2:B11), then type a comma.
  4. Select the range to return from (D2:D11), type ) and press Enter.

The two ranges should line up, row for row. The return column can be to the left or the right of the search column. Depending on your region settings, Excel may expect semicolons instead of commas.

Show your own message when nothing matches

=XLOOKUP(F2, B2:B11, D2:D11, "Not found")

Without this fourth part, a missing value gives #N/A.

Copy the formula down

When you fill a formula down, ordinary cell references move with it. Add dollar signs to keep the two ranges fixed:

=XLOOKUP(F2, $B$2:$B$11, $D$2:$D$11, "Not found")

In the formula bar, select a reference and press F4 to switch between reference types.

Return more than one column

Make the return range wider, and one formula fills several cells. For example, =XLOOKUP(F2, B2:B11, C2:D11) returns the matching values from both column C and column D. Leave the cell to the right empty so the second result has room.

All six parts

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

Useful variations

Which versions of Excel have it

XLOOKUP is in Excel for Microsoft 365, Excel for the web, Excel 2024 and Excel 2021. It is not available in Excel 2016 or Excel 2019, even though you may open a workbook there that someone made with it in a newer version. If you share files with people on those versions, use VLOOKUP, for example =VLOOKUP(F2, B2:D11, 3, FALSE). VLOOKUP searches the first column of the range, and FALSE asks for an exact match.

If you get #N/A

Check that the value is really in the search range, that both sides are the same type (a number is not the same as a number stored as text), and that there are no extra spaces. See Why does my Excel formula show as text, or my VLOOKUP give #N/A, and what can I try?

Official Microsoft pages

If you want someone to talk you through the problem

Want someone to talk you through it? The Application tutor is a Zoom video call: $60 for one hour, $120 for two. You need to book at least 24 hours ahead. List the applications you need help with when you book. We talk you through them, as many as time allows. We never ask for a password or a sign-in code. We cannot promise a fix. We are not part of the companies named here, and they do not endorse us.

The page "How do I use XLOOKUP in Excel?" was last changed on December 5, 2026.

Terms and refunds

Privacy