XLOOKUP
XLOOKUP
Microsoft
Support
Microsoft 365
Office
XLOOKUP
Article
VLOOKUP
Article
SUM function
Article
COUNTIF function
Article
IF function
Article
IFS
Article
SUMIF
Article
SUMIFS
Article
MATCH
Article
Note: XLOOKUP is not available in Excel 2016 and Excel 2019, however, you may come across a situation of using a workbook
Syntax
The XLOOKUP function searches a range or an array, and then returns the item corresponding to the first match it finds. If no
Descripti
Argument
on
The value
lookup_v
to search
alue
for
*If
omitted,
XLOOKUP
returns
Required
blank
*
cells it
finds in
lookup_a
rray.
lookup_a
rray The array
or range
to search
Required
return_ar
ray The array
or range
to return
Required
Where a
valid
match is
not
[if_not_fo found,
und] return the
[if_not_fo
und] text
you
supply.
If a valid
match is
not
found,
and
Optional
[if_not_fo
und] is
missing,
#N/A is
returned.
Specify
[match_
the match
mode]
type:
0 - Exact
match. If
none
found,
Optional
return
#N/A.
This is the
default.
-1 - Exact
match. If
none
found,
return the
next
smaller
item.
1 - Exact
match. If
none
found,
return the
next
larger
item.
Specify
the
[search_
search
mode]
mode to
use:
1-
Perform a
search
starting at
Optional
the first
item. This
is the
default.
-1 -
Perform a
reverse
search
starting at
the last
item.
2-
Perform a
binary
search
that relies
on
lookup_ar
ray being
sorted in
ascending
order. If
not
sorted,
invalid
results
will be
returned.
-2 -
Perform a
binary
search
that relies
on
lookup_ar
ray being
sorted in
descendin
g order. If
not
sorted,
invalid
results
will be
returned.
Examples
Example 1 uses XLOOKUP to look up a country name in a range, and then return its telephone country code. It includes the l
Note: XLOOKUP uses a lookup array and a return array, whereas VLOOKUP uses a single table array followed by a column inde
———————————————————————————
Example 2 looks up employee information based on an employee ID number. Unlike VLOOKUP, XLOOKUP can return an arra
———————————————————————————
———————————————————————————
Example 4 looks in column C for the personal income entered in cell E2, and finds a matching tax rate in column B. It sets the
Note: XARRAY's lookup_array column is to the right of the return_array column, whereas VLOOKUP can only look from left-to
———————————————————————————
Example 5 uses a nested XLOOKUP function to perform both a vertical and horizontal match. It first looks for Gross Profit in
Tip: You can also use XLOOKUP to replace the HLOOKUP function.
———————————————————————————
Example 6 uses the SUM function, and two nested XLOOKUP functions, to sum all the values between two ranges. In this cas
How does it work? XLOOKUP returns a range, so when it calculates, the formula ends up looking like this: =SUM($E$7:$E$9). Y
Note: Thanks to Microsoft Excel MVP, Bill Jelen, for suggesting this example.
———————————————————————————
See also
You can always ask an expert in the Excel Tech Community or get support in Communities.
XMATCH function
Explore subscription benefits, browse training courses, learn how to secure your device, and more.
Microsoft security
Accessibility center
Surface Pro
Surface Laptop
Surface Laptop Studio 2
Surface Laptop Go 3
Microsoft Copilot
Copilot in Windows
Explore Microsoft products
Windows 11 apps
Microsoft Store
Account profile
Download Center
Microsoft Store support
Returns
Order tracking
Certified Refurbished
Microsoft Store Promise
Flexible Payments
Education
Microsoft in education
Devices for education
Microsoft Teams for Education
Microsoft 365 Education
How to buy for your school
Educator training and development
Deals for students and parents
Azure for students
Business
Microsoft Cloud
Microsoft Security
Dynamics 365
Microsoft 365
Microsoft Power Platform
Microsoft Teams
Copilot for Microsoft 365
Small Business
Developer & IT
Azure
Developer Center
Documentation
Microsoft Learn
Microsoft Tech Community
Azure Marketplace
AppSource
Visual Studio
Company
Careers
About Microsoft
Company news
Privacy at Microsoft
Investors
Diversity and inclusion
Accessibility
Sustainability
Sitemap
Contact Microsoft
Privacy
Terms of use
Trademarks
Safety & eco
Recycling
About our ads
© Microsoft 2024
ice of an automotive part by the part number, or find an employee name based on their employee ID. With XLOOKUP, you can look in one
situation of using a workbook in Excel 2016 or Excel 2019 with the XLOOKUP function in it created by someone else using a newer version
o the first match it finds. If no match exists, then XLOOKUP can return the closest (approximate) match.
country code. It includes the lookup_value (cell F2), lookup_array (range B2:B11), and return_array (range D2:D11) arguments. It doesn'
ray followed by a column index number. The equivalent VLOOKUP formula in this case would be: =VLOOKUP(F2,B2:D11,3,FALSE)
P, XLOOKUP can return an array with multiple items, so a single formula can return both employee name and department from cells C5:D1
ax rate in column B. It sets the if_not_found argument to return 0 (zero) if nothing is found. The match_mode argument is set to 1, which
KUP can only look from left-to-right.
t first looks for Gross Profit in column B, then looks for Qtr1 in the top row of the table (range C5:F5), and finally returns the value at the i
etween two ranges. In this case, we want to sum the values for grapes, bananas, and include pears, which are between the two.
like this: =SUM($E$7:$E$9). You can see how this works on your own by selecting a cell with an XLOOKUP formula similar to this one, the
XLOOKUP, you can look in one column for a search term and return a result from the same row in another column, regardless of which sid
P(F2,B2:D11,3,FALSE)
ode argument is set to 1, which means the function will look for an exact match, and if it can't find one, it returns the next larger item. Fina
nally returns the value at the intersection of the two. This is similar to using the INDEX and MATCH functions together.
ormula similar to this one, then select Formulas > Formula Auditing > Evaluate Formula, and then select Evaluate to step through the calcu
olumn, regardless of which side the return column is on.
urns the next larger item. Finally, the search_mode argument is set to 1, which means the function will search from the first item to the la
luate to step through the calculation.
ch from the first item to the last.