212312020 How to use the Excel XLOOKUP function | Excaljat
EXCELJET
Quick, clean, and to the point
Cart Login
Training Videos Functions Formulas Shortcuts Blog
Search... Search
Excel XLOOKUP Function
g
fe | =XLOOKUP(F4,B4:812,04:D12)
Diameter
6,792] <— result
alue
Summary
The Exce] XLOOKUP function is a modern and flexible replacement for older functions
like VLOOKUP, HLOOKUP, and LOOKUP. XLOOKUP supports approximate and exact
matching, wildcards (* ?) for partial matches, and lookups in vertical or horizontal
ranges.
Purpose
ntpsufexcelet neviexce Hunctions/excel-xlookup function 11282812020 How to use the Excel XLOOKUP function | Excajet
Find values in range or table
Return value
Best match (exact or approximate)
Syntax
=XLOOKUP (lookup, lookup_array, return_array, [not_ found], [match_mode],
[search_mode})
Arguments
lookup - The lookup value.
lookup _array - The array or range to search.
return_array - The array or range to return.
not_found - [optional] Value to return if no match found.
match_mode - [optional] 0 = exact match (default), -1 = exact match or next smallest,
1 = exact match or next larger, 2 = wildcard match.
search_mode - [optional] 1 = search from first (default), -1 = search from last, 2 =
binary search ascending, -2 = binary search descending.
Usage notes
XLOOKUP is a modem replacement for the VLOOKUP function. It is a flexible and
versatile lookup function that can be used in a wide variety of situations.
XLOOKUP can find values in vertical or horizontal ranges, can perform approximate
and exact matches, and supports wildcards (* ?) for partial matches. In addition,
XLOOKUP can search data sta
type and search mode details below). Compared to older functions like VLOOKUP,
HLOOKUP, and LOOKUP, XLOOKUP offers several key advantages.
ting from the first value or the last value (see match
Not found message
ntpsufexcelet neviexce Hunctions/excel-xlookup function 2128ieai2020 How to use the Excel XLOOKUP function | Excajet
When XLOOKUP can't find a match, it returns the #N/A error, like other match
functions in Excel. Unlike the other match functions, XLOOKUP supports an optional
argument called not_found that can be used to overide the #N/A error when it would
otherwise appear. Typical values for not_found might be "Not found’, "No match”, "N
result’, etc. When providing a value for not_found, enclose the text in double quotes
Note: Be careful if you supply an empty string ("") for not found. If no match is found,
XLOOKUP will display nothing instead of #N/A. If you want to see the #N/A error when a
match isn't found, omit the argument entirely.
Match type
By default, XLOOKUP will perform an exact match. Match behavior is controlled by an
optional argument called match_type, which has the following options:
Match type Behavior
0 (default) Exact match. Will return #N/A if no match.
-1 Exact match or next smaller item.
1 Exact match or next larger item.
2 Wildcard match (*, ?, ~)
Search mode
By default, XLOOKUP will start matching from the first data value. Search behavior is
controlled by an optional argument called search_mode, which provides the following
options:
Search mode Behavior
1 default) Search from first value
aT Search from last value (reverse)
2 Binary search values sorted in ascending order
-2 Binary search values sorted in descending order
hitpsslexceljt netlexcelfunctionsiexcelxlookup-functon 3128zasianee How toute the Excl LOOKUP fron | Exclt
Binary searches are very fast, but data must be sorted as required. If data is not sorted
properly, a binary search can return invalid results that look perfectly normal.
Example #1 - basic exact match
By default, XLOOKUP will perform an exact match. In the example below, XLOOKUP is
used to retrieve Sales based on an exact match on Movie. The formula in H5 is:
= XLOOKUP(H4,B5:B9,E5:E9)
HS . fe | =XLOOKUP(H4,B5:89,£5:69)
A B c jp E F 6 H
fl
2 XLOOKUP - basic exact match
3
4 Movie Year Rank Sales Movie Toy Stor
s| Fargo 1996 5 | $61m Sales $362
6 LA. Confide 1997 4 | $126m
7 The Sixth Sense 19991 $673m
a| Toy Story 1995 2 | $362m
9 Unforgiven 1992 3 $159m
More detailed explanation here.
Example #2 - basic approximate match
To enable an approximate match, provide a value for the "match_mode" argument. In
the example below, XLOOKUP is used to calculate a discount based on quantity, which
requires an approximate match. The formula in FS supplies -1 for match_mode to
enable approximate match with “exact match or next smallest” behavior:
= XLOOKUP(E5,B5:B9,C5:C9,, - 1)
ntpsufexcelet neviexce Hunctions/excel-xlookup function 41282812020 How to use the Excel XLOOKUP function | Excajet
Fs > fe | =XLOOKUP(ES,B5:89,C5:C9,,-1)
A B ce |b E F 6
1
2 XLOOKUP basic approximate match
3
4 Quantity Discount Quantity Result
5 o 0% 28]
6 10 5%
i 25 10%
8 50 20%
9 100 25%
More detailed explanation here.
Example #3 - multiple values
XLOOKUP can return more than one value at the same time for the same match. The
example below shows how XLOOKUP can be configured to return three matchging
values with a single formula. The formula in C5 is:
= XLOOKUP (BS, B8:B15,C8:E15)
=XLOOKUP(B5,88:815,C8:E15)
E | oF G
Department
Fulfillment
cS . &
A |B eC D
1
2 XLOOKUP - multiple values
3
4 1D First Last
5 841[Evelyn TMonet
6
7 ID First Last
8 610 Janet Farley
9 798 Steven Batista
10 841 Evelyn Monet
1 886 Marilyn _ Bradley
2 622 Jonathan _ Adder
1B 601 Adrian
14 869 Julie
15 867 Erica Tan
16
ntpsufexcelet neviexce Hunctions/excel-xlookup function
Department
Fulfillment
Sales
Fulfillment
Fulfillment
Marketing
Engineering
Sales |
Fulfillment
51282reai2020 How to use the Exeal XLOOKUP function | Excaliat
Notice the return array (C8:E15) includes 3 columns: First, Last, Department. All three
values are returned and spill into the range C5:ES.
Example #4 - two-way lookup
XLOOKUP can be used to perform a two-way lookup, by nesting one XLOOKUP inside
another. In the example below, the "inner" XLOOKUP retrieves an entire row (all values
for Glass), which is handed off to the “outer” XLOOKUP as the return array. The outer
XLOOKUP finds the appropriate group (B) and returns the corresponding value (17.25)
as the final result.
= XLOOKUP (16, C4: F4, XLOOKUP(I5,B5:B9,C5:F9))
7 . =XLOOKUP(I6,C4:F4, XLOOKUP(I5,85:89,C5:F3))
A B | c | bD —e | FG H 1 J
sf
2 XLOOKUP two-way lookup
2
a| A B c D
5 Vinyl 10.00 11.50 13.23 15.21 Material Glass
6 Wood 12.00 13.80 15.87 18.25 Group B
7 Glass 15.00 17.25 19.84 22.81 Result 17.25]
8 Steel 18.00 20.70 23.81 27.38,
= Titanium 23.00, 26.45 30.42 34.98,
10
1
More details here.
Example #5 - not found message
Like other lookup functions, if XLOOKUP does not find a value, it returns the #N/A
error. To display a custom message instead of #N/A, provide a value for the optional
“not found’ argument, enclosed in double quotes (
found" when no matching movie is found, based on the worksheet below, use:
). For example, to display "Not
= XLOOKUP(H4,B5:B9,£5:E9,"Not found”)
ntpsufexcelet neviexce Hunctions/excel-xlookup function 61282812020 How to use the Excel XLOOKUP function | Excajet
HS . J | =XLOOKUP(H4,B5:89,£5:£9,"Not found")
A B jec|o e |r 6
fl
2 XLOOKUP - not found
3
4 Movie Year Rank Sales Movie (Godzilla
5 Fargo 1996 5 $61m Sales [Not found
6 LA. Confidential | 1997 4 $126m
7 ‘The Sixth Sense | 1999 1 $673m
8 Toy Story 1995 2 $362m
9 Unforgiven 1992, 3 $159m
10
Movie not found’, etc.
You can customize this message as you like: "No mate!
Example #6 - complex criteria
With the ability to handle arrays natively, XLOOKUP can be used with complex criteria.
In the example below, XLOOKUP is matching the first record where: account begins
with "x’ and region is "east" and month is not April:
= XLOOKUP(1, (LEFT(B5:B16) = "x") *
"east") * NOT(MONTH(D5:D16) = 4),B5:£16)
6s ’ Je | =XLOOKUP(1,(LEFT(B5:816)="*")*(C5:C16="east")*NOT(MONTH(D5:016)
A 8 ic D G Le 6 # I i eae
1
2 XLOOKUP with complex multiple criteria
3
4 ‘Account Region Date Amount ‘Account
5 3000-150 West 11-Apr-20 24,0001 [3000-050
6 7300-050 West 14-Apr-20 21,750
7 1020-030 East 20-Apr-20 11,250
8 |= x3000-050 East 11-May-20 4,500
9 3000-150 East 25-May-20 12,750
10 7020-025 West SJun-20 7,500
Details: (1) simple example, (2) more complex example.
XLOOKUP benefits
XLOOKUP offers several important advantages, especially compared to VLOOKUP:
ntpsufexcelet neviexce Hunctions/excel-xlookup function 71282812020 How to use the Excel XLOOKUP function | Excajet
* XLOOKUP can lookup data to the right or left of lookup values
XLOOKUP can return multiple results (example #3 above)
XLOOKUP defaults to an exact match (VLOOKUP defaults to approximate)
XLOOKUP can work with vertical and horizontal data
XLOOKUP can perform a reverse search (last to first)
XLOOKUP can return entire rows or columns, not just one value
XLOOKUP can work with arrays natively to apply complex criteria
Notes
1. XLOOKUP can work with both vertical and horizontal arrays.
2, XLOOKUP will retum #N/A if the lookup value is not found.
3. The lookup_array must have a dimension compatible with the return_array
argument, otherwise XLOOKUP will return #VALUE!
4, If XLOOKUP is used between workbooks, both workbooks must be open,
otherwise XLOOKUP will return #REF!.
5. Like the INDEX function, XLOOKUP returns a reference as a result.
in Office 365 only.
XLOOKUP formula examples
XLOOKUP rearrange columns
XLOOKUP can be used to reorder columns, by nesting
one XLOOKUP inside another. In the example shown,
a. The formula in G9 is:
=XLOOKUP(G8:]8,B4:E4,XLOOKUP(G5,ES:E15,B5:E15)) Which returns a match on the
value in GS,...
SUMIFS vs other lookup formulas
In certain cases, you can use SUMIFS like a lookup formula to retrieve a numeric value.
In the example shown, the formula in G6 is: =SUMIFS(sales,region,G4,quarter,G5)
where region (B5:B20), quarter (C5:C20), and...
ntpsufexcelet neviexceHunctions/excel-xlookup function 812822812020 How to use the Excel XLOOKUP function | Excajet
XLOOKUP two-way exact match
To perform a two-lookup with the XLOOKUP function
(a double XLOOKUP), you can nest one XLOOKUP
inside another. In the example shown, the formula in
H6 is:
=XLOOKUP(HS, months,XLOOKUP(H4,names,data)) where months (C4...
XLOOKUP basic approximate match
‘To use XLOOKUP to find an approximate match,
supply the match_mode explicitly in the forth
argument. In the example shown, the formula in F5,
copied down the table, is: =XLOOKUP(ES,qty,disc,-1)
where qty (B5:B13)...
Lookup lowest Monday tide
To find the lowest tide on a Monday, given a set of data
with many days of high and low tides, you can use an
array formula based on the IF and MIN functions. In
the example shown, the formula in I6 is:
Categorize text with keywords
To categorize text using keywords with a “contains”
match, you can use the SEARCH function, with help
from INDEX and MATCH. In the example shown, the
= os formula in C5 is:
{-INDEX (categories, MATCH(TRUE,ISNUMBER(SEARCH(...
= XLOOKUP lookup row or column
XLOOKUP can be used to lookup and retrieve rows or
columns. In the example shown, the formula in HS is:
=XLOOKUP(H4,C4:F4,C5:F8) Since all data in the
ntpsufexcelet nevexceHunctions/excel-xlookup function 91282812020 How to use the Excel XLOOKUP function | Excajet
C5:F8 is provided as the return_array XLOOKUP returns the range...
XLOOKUP latest by date
To get the latest match in a set of data by date, you can
use XLOOKUP in approximate match mode by setting
match_mode to -1. In the example shown, the formula
in G5, copied down, is: =XLOOKUP(MAX (date),
XLOOKUP basic exact match
To use XLOOKUP to find an exact match, you'll need to
supply a lookup value, a lookup range, and a result
range. In the example shown, the formula in H6 is:
=XLOOKUP(G4,B5:B18,D5:D18) which returns
XLOOKUP lookup left
XLOOKUP can be used to find values to the left of the
lookup value. In the example shown, the formula in H6
: is: -XLOOKUP(H4,E5:E14,B5:B14) which returns 25,
: the height in column B for model H in row 12. How
Reverse VLOOKUP example
To reverse a VLOOKUP ~ ice, to find the original
lookup value using a VLOOKUP formula result ~ you
can use a tricky formula based on the CHOOSE
function, or more straightforward formulas based on
INDEX and MATCH or...
XLOOKUP horizontal lookup
a To perform a horizontal lookup with the XLOOKUP
: function, supply a lookup value, a lookup array, and a
result array. Provide a match_mode argument
E for approximate match if needed. In the example
shown, the formula in IS...
XLOOKUP date of max value
ntpsufexcelet neviexceHunctions/excel-xlookup function 10128arzaieoz0 How to use the Excel XLOOKUP function | Excalit
To use XLOOKUP to find the date of the max value,
—— you can use the MAX function and XLOOKUP
together. In the example shown, the formula in F4 is:
=XLOOKUP(MAX (values), values,dates) where values
(C4:C15) and dates (B4...
<=] XLOOKUP last match
To retrieve the last match in a data set with XLOOKUP,
set the fifth argument to -1. In the example shown, the
formula in GS, copied down, is:
=XLOOKUP(F5, item, price,0,-1) where item (B5:B15)
XLOOKUP with multiple criteria
To use XLOOKUP with multiple criteria, you can
concatenate lookup values and lookup arrays directly
in the formula. In the example shown, the formula in
; HB is:
=XLOOKUP(HS &H6&H7,B5:B14&C5:C14&D5:D14,E5...
Related videos
SSE Basic XLOOKUP example
oy In this video, we'll set up the XLOOKUP function with
a basic example. Matching on City name, we'll retrieve
aS Se Country and Population.
Related functions
Excel XMATCH Function
The Excel XMATCH function performs a lookup and
returns a position in vertical or horizontal ranges. It is
amore robust and flexible successor to the MATCH
hitpsslexceljt netlexcelfunctionsiexcelxlookup-functon 11108arzazo20 How to use the Excl XLOOKUB funeon | Excalt
function. XMATCH supports approximate and exact
matching, reverse search, and wildcards...
Excel FILTER Function
The Excel FILTER function filters a range of data based
on supplied criteria, and extracts matching records.
Excel VLOOKUP Function
VLOOKUP is an Excel function to lookup and retrieve
data from a specific column in table. VLOOKUP
supports approximate and exact matching, and
wildcards (* ?) for partial matches. The "V" stands for
“vertical”. Lookup values must appear in the...
Excel INDEX Function
The Excel INDEX function returns the value at a given
position in a range or array. You can use index to
retrieve individual values or entire rows and columns.
INDEX is often used with the MATCH function, where
MATCH locates and feeds a position to...
Excel MATCH Function
MATCH is an Excel function used to locate the position
of a lookup value in a row, column, or table. MATCH
supports approximate and exact matching, and
E wildcards (* 2) for partial matches. Often, the INDE
— sie Excel LOOKUP Function
The Excel LOOKUP function performs an approximate
match lookup in a one-column or one-row range, and
returns the corresponding value from another one-
ir L column or one-row range. LOOKUP’s default behavior
makes it useful for solving certain problems...
ntpsufexcelet nevexceHunctions/excelxlookup function 121282ieai2020
fee) it
FORMULA
Pte eT
How ous the Excel LOOKUP uneon | Excalt
Excel HLOOKUP Function
HLOOKUP is an Excel function to lookup and retrieve
data from a specific row in table. The "H" in HLOOKUP
stands for “horizontal”, where lookup values appear in
the first row of the table, moving horizontally to the
right. HLOOKUP supports...
Excel Formula Training
Formulas are the key to getting things done in
Excel. In this accelerated training, you'll learn
how to use formulas to manipulate text, work
with dates and times, lookup values with
VLOOKUP and INDEX & MATCH, count and
sum with criteria, dynamically rank values, and
create dynamic ranges. You'll also learn how to
troubleshoot, trace errors, and fix problems.
Instant access. See details here.
Download 200+ Excel Shortcuts
Get over 200 Excel shortcuts for Windows and Mac in one handy PDF.
email address
Topics
hitpsslexceljt netlexcelfunctionsiexcelxlookup-functon
1328