0% found this document useful (0 votes)
15 views120 pages

Excel Basics

This document provides an overview of various Excel lookup functions including XLOOKUP, FILTER, XMATCH, LOOKUP, and SWITCH, detailing their capabilities and use cases. It emphasizes the importance of understanding these functions for efficient data retrieval and comparison in Excel. Additionally, it highlights considerations for using these functions effectively, such as handling duplicates and the order of records.

Uploaded by

daihaiphan.ix
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views120 pages

Excel Basics

This document provides an overview of various Excel lookup functions including XLOOKUP, FILTER, XMATCH, LOOKUP, and SWITCH, detailing their capabilities and use cases. It emphasizes the importance of understanding these functions for efficient data retrieval and comparison in Excel. Additionally, it highlights considerations for using these functions effectively, such as handling duplicates and the order of records.

Uploaded by

daihaiphan.ix
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 120

Any Excel Lookup Task wit

XLOOKUP, LOOKUP
FILTER, SWITCH
XMATCH
Excel Basics #6

Len
98 MS 365 Excel Basics 06: Mastering Excel Lookup: XLOOKUP, FILTER, XMATCH, LOOKUP, SWITCH Functions!

XLOOKUP FILTER
lookup a value from a cell One Lookup Value, Return Multiple Items
Lookup a column
Lookup a row XMATCH
Lookup a cell reference Comapare Two Lists
Lookup a range
Perform exact match lookup LOOKUP
Perform exact match or next smaller Binary Search - REALLY fast
Perform exact match or next bigger Use when lookup table first column sorted A-Z
Perfom wildcard lookup like all tax tables, commision tables & rate tables
Perform binary search Benefit is that formula is easier and faster to create
Search first-to-last
Search last-to-first SWITCH
& much more! Can lookup anything: formulas, tables,
ask with:
OKUP
H X

UP, SWITCH Functions!

X
X
Len
100 MS 365 Excel Basics 06: XLOOKUP, FILTER, XMATCH, LOOKUP, SWITCH Functions to Master Any

XLOOKUP
lookup a value from a cell
Lookup a column
Lookup a row
Perform exact match lookup
Perform exact match or next smaller
Perform exact match or next bigger
Perfom wildcard lookup
Perform binary search
Search first-to-last
Search last-to-first
Lookup a cell reference
Lookup a range
X
& much more!

Not Covered in Video, but important too:


INDEX
Uses row and column numbers to lookup values from an array
CHOOSE
Uses sequential numbers to lookup items from within the argumnets of CHOOSE
KUP, FILTER, XMATCH, LOOKUP, SWITCH Functions to Master Any Lookup Task!

FILTER
One lookup value, return multiple items

XMATCH
Return relative position of an item in a list
Comapare Two Lists
LOOKUP
Binary Search - REALLY fast
Use when lookup table first column sorted A-Z
like all tax tables, commision tables & rate tables
Benefit is that formula is easier and faster to create

SWITCH
Can lookup anything: formulas, tables,
to lookup values from an array

okup items from within the argumnets of CHOOSE


X
Link to Sheet: Topics:
1 AI anf IF? You Must Know Excel Well Before Using AI
2 XLOOKUP XLOOKUP function
3 EM(3) 1) Exact Match Lookup
4 Record 2) Lookup a Record
5 Column 3) Lookup a Column
6 NextSmaller(3) 4) Exact Match or Next Smaller Lookup
7 VorH 5) Vertical or Horizontal Lookup
8 NextBigger 6) Exact Match or Next Bigger Lookup
9 Wild 7) Wild Card Lookup
10 First 7) Lookup First Item
11 Last 8) Lookup Last Item
12 2LookupValues 10) Two Lookup Values
13 2Way 9) Two-Way Lookup
14 FILTER FILTER function
15 Duplicates Single Lookup Value, Return Multiple Matches
16 XMATCH XMATCH function
17 CompareLists Compare Two Lists
18 LOOKUP LOOKUP function
19 H and V 1) Lookup a value in a vertical range and return an item from a horizontal range
20 Tax 2) Tax Example where LOOKUP beats XLOOKUP
21 Binary Search See Example of how fast Binary Search Is
22 SWITCH SWITCH function
23 Tables Lookup a Table
Homework ==>> 11 Amazing Homework Problems ==>>
#NAME?
#NAME?
#NAME?
#NAME?
#NAME?
#NAME?
#NAME?
#NAME?
#NAME?
#NAME?
#NAME?

rizontal range
What happens if we ask AI to help us build Excel solutions?

Let's try to ask this question:

I would like an Excel formula that can assign an "A+" grade to 95% or higher, an "A" grade to less than 95%
and greater than or equal to 90%, a "B+" grade to less than 90% and greater than or equal to 85%, a "B"
grade to less than 85% and greater than or equal to 80%, a "C+" grade to less than 80% and greater than or
equal to 75%, a "C" grade to less than 75% and greater than or equal to 70%, a "D+" grade to less than 70%
and greater than or equal to 65%, a "D+" grade to less than 65% and greater than or equal to 60%,and a "F"
grade to all other scores that are less than 60%.
de to less than 95%
qual to 85%, a "B"
and greater than or
de to less than 70%
ual to 60%,and a "F"
When you ask AI a question about building a solution in Excel, AI WILL give you an answer, but the a
For example, if you ask a reasonable question like this:
I would like an Excel formula that can assign an "A+" grade to 95% or higher, an "A" grade to less than 95% and greater th
to less than 90% and greater than or equal to 85%, a "B" grade to less than 85% and greater than or equal to 80%, a "C+"
greater than or equal to 75%, a "C" grade to less than 75% and greater than or equal to 70%, a "D+" grade to less than 70%
65%, a "D+" grade to less than 65% and greater than or equal to 60%,and a "F" grade to all other scores that are less than

This is what Chat GPT 4 returns as an answer:


Err:509
Err:509
Problems: Err:509
Too Complicated.
% Values must be evaluated
Violates Excel's Golden Rule
Chat GPT 4 Chat GPT 4 Better
Student Score IFS Nested IF XLOOKUP
Sioux 0.68 D+ D+ #NAME?
Kimmy 0.51 F F #NAME?
RadCoolinator 0.76 C+ C+ #NAME?
Chantel 0.99 A+ A+ #NAME?
Sheladawn 0.925 A A #NAME?
T 0.97 A+ A+ #NAME?
Bob 0.49 F F #NAME?
Willie 0.56 F F #NAME?
Malcolm 0.84 B B #NAME?
Gigi 0.76 C+ C+ #NAME?
Hin 0.77 C+ C+ #NAME?
Chin 0.93 A A #NAME?
Miki 0.79 C+ C+ #NAME?
Pollock 0.66 D+ D+ #NAME?
WILL give you an answer, but the answer may not always be a very good answer.

n "A" grade to less than 95% and greater than or equal to 90%, a "B+" grade
% and greater than or equal to 80%, a "C+" grade to less than 80% and
equal to 70%, a "D+" grade to less than 70% and greater than or equal to
grade to all other scores that are less than 60%.

Err:509

Best How it looks in syllabus:


LOOKUP Score Grade
D+ 0F Score Grade
F 0.6 D 95% A+
C+ 0.65 D+ 90% A
A+ 0.7 C 85% B+
A 0.75 C+ 80% B
A+ 0.8 B 75% C+
F 0.85 B+ 70% C
F 0.9 A 65% D+
B 0.95 A+ 60% D
C+ 0% F
C+
A
C+
D+
Notes:
1) The lookup_array does not need to be sorted in a particular order, unless you use the search_mode binary options.
2) When you use the match_modes Exact match, Exact match or next smaller, or Exact match or next bigger, if there a
the search_modes Search first-to-last and Search last-to-first yield the same results. Said a different way: when the
the order of records in the lookup table and the direction of the search have no effect on the result.
3) In situations where there are duplicates in the lookup_array, the direction of the search, either Search first-to-last o
results. For example, in a sales table with many duplicate sales rep names and a sorted date or invoice column, you
by a sales rep (Search first-to-last) or the last sale made by a sales rep (Search last-to-first). In situations like this, the
the direction of the search directly effect the value that is returned by the XLOOKUP function.
4) If you have typical tax or commission or sales discount lookup table, where the first column in the lookup table is sor
use the LOOKUP function rather than the XLOOKUP function because it 1) calculates more quickly because of its bin
2) It takes less time to create the formula because it needs only 2 arguments, whereas the XLOOKUP requires 5 or 6
lookup_array = [return_array] = [if_not_fou
search for lookup_value to yield relative position from lookup_array is used specifies th
a relative position. Can be a to retrieve item from [return_array]. Can be the lookup_
lookup_value = column or a row (not a table) a column or a row (not a table) the lookup_
Item to lookup

XLOOKUP( lookup_value, lookup_array, return_array, [if_not_found],


[match_mode], [search_mod

[match_mode] = type of lookup: [search_mode] = how


0 - Exact match (default) 1 - Search first-to-las
-1 - Exact match or next smaller -1 - Search last-to-firs
1 - Exact match or next larger 2 - Binary search: loo
2 - Wildcards: * for zero or more characters or ? for a single character 2 - Binary search: loo
3 - Regex match: Match based on regex pattern, case sensitive

1) The lookup_array does not need to be sorted in a particular order, unless you use the search_mode binary options.
2) When you use the match_modes Exact match, Exact match or next smaller, or Exact match or next bigger, if there are NO duplicat
the search_modes Search first-to-last and Search last-to-first yield the same results. Said a different way: when there are NO dupl
the order of records in the lookup table and the direction of the search have no effect on the result.
3) In situations where there are duplicates in the lookup_array, the direction of the search, either Search first-to-last or Search last-to
results. For example, in a sales table with many duplicate sales rep names and a sorted date or invoice column, you could look up
by a sales rep (Search first-to-last) or the last sale made by a sales rep (Search last-to-first). In situations like this, the order of reco
the direction of the search directly effect the value that is returned by the XLOOKUP function.
4) If you have typical tax or commission or sales discount lookup table, where the first column in the lookup table is sorted A-Z and th
use the LOOKUP function rather than the XLOOKUP function because it 1) calculates more quickly because of its binary search and
2) It takes less time to create the formula because it needs only 2 arguments, whereas the XLOOKUP requires 5 or 6 arguments.

=
d A-Z
d Z-A
A B C D E F G H I
1
2 When there are no duplicates, order of records and search direction has no effect on returned value:
3
4 Search First To Last Search Last To First
5 Exact Match Exact Match
6 Err:509 Err:509
7 Product Carlota Product Carlota
8 Price 32 <= Same => Price 32
9
10 Product Price Product Price
11 Quad 43 Quad 43
12 Carlota 32 Carlota 32
13 Sunshine 28 Sunshine 28
14 Aspen 25 Aspen 25
15
16 Exact Match or Next Smaller Exact Match or Next Smaller
17 Err:509 Err:509
18 Sales 1250 Sales 1250
19 Price 0.2 <= Same => Price 0.2
20
21 Sales Discount Sales Price
22 0 0 0 0
23 2500 0.4 1000 0.2
24 1000 0.2 500 0.1
25 500 0.1 2500 0.4
26
27 Exact Match or Next Larger Exact Match or Next Larger
28 Err:509 Err:509
29 Sales 1250 Sales 1250
30 Price 0.4 <= Same => Price 0.4
31
32 Sales Discount Sales Price
33 0 0 0 0
34 2500 0.4 1000 0.2
35 1000 0.2 500 0.1
36 500 0.1 2500 0.4
37
A B C D E F G H I J K L M N
1
2 When there are duplicates, the order of records and search direction can effect the returned value:
3
4 Search First To Last Search First To Last Search Last To First
5 Goal: Get first sale for SalesRep Goal: Get first sale for SalesRep Goal: Get last sale for SalesRep
6 Exact Match Exact Match Exact Match
Order of Search
7 Err:509 Err:509 records in Err:509 direction
table changes, changed, so
8 SalesRep Sioux SalesRep Sioux so result is SalesRep Sioux result is
9 Sales 640.56 Sales 1589.69 different Sales 474.26 different
10
11 Date SalesRep Sales Date SalesRep Sales Date SalesRep Sales
12 10/3/2021 Sioux $640.56 10/3/2021 Chin $1,706.02 10/3/2021 Sioux $640.56
13 10/3/2021 Chin $1,706.02 10/4/2021 Sioux $1,589.69 10/3/2021 Chin $1,706.02
14 10/4/2021 Sioux $1,589.69 10/5/2021 Chin $786.13 10/4/2021 Sioux $1,589.69
15 10/4/2021 Chin $695.31 10/4/2021 Chin $695.31 10/4/2021 Chin $695.31
16 10/5/2021 Sioux $474.26 10/3/2021 Sioux $640.56 10/5/2021 Sioux $474.26
17 10/5/2021 Chin $786.13 10/5/2021 Sioux $474.26 10/5/2021 Chin $786.13
18 Note: The match_modes Exact match or next smaller and Exact match or next larger behave the same as the Exact Match example above.
Goal: Lookup product price using "Exact match lookup"
Product Price
Quad 43.95

Match?
Retrieve
Lookup Table:
ProductID Product Cost Price
A25C-4884 Aspen 14.55 26.95
C20G-4398 Carlota 11.18 27.95
Q22G-9634 Quad 19.34 43.95
S35G-4382 Sunshine 11.25 22.95
Corresponding position
Y30C-4942 Yanaki 12.88 29.95
Goal: Lookup product price using "Exact match" lookup
Old School 1:
Product Price Product First
Quad Quad 43.95 Formula in I5:

Lookup Table: Formula in C5:

ProductID Product Cost Price


A25C-4884 Aspen 14.55 26.95
C20G-4398 Carlota 11.18 27.95
Q22G-9634 Quad 19.34 43.95
S35G-4382 Sunshine 11.25 22.95
Y30C-4942 Yanaki 12.88 29.95
=VLOOKUP(H5,$C$10:$E$14,3,0)
Goal: Lookup product price using "Exact match" lookup
Old School 1:
Product Price Product First
Sunshine 22.95 Quad 43.95 Formula in I5:

Lookup Table: Formula in C5: =_xlfn.xlookup(B5,tProduct5[Product],tProduct5[Price],"Not In List")

ProductID Product Cost Price


A25C-4884 Aspen 14.55 26.95
C20G-4398 Carlota 11.18 27.95
Q22G-9634 Quad 19.34 43.95
S35G-4382 Sunshine 11.25 22.95
Y30C-4942 Yanaki 12.88 29.95
=VLOOKUP(H5,$C$10:$E$14,3,0)

duct5[Price],"Not In List")
Goal: Lookup employee record based on EmployeeID in cell B5.

EmployeeID First Last StartDate CellPhone Department


4369-9084

Formula in D5:

EmployeeID First Last StartDate CellPhone Department


4369-9084 Sioux Chin 10/6/2012 206-767-2190 Accounting
4369-4774 Ty Smithe 11/15/2011 435-398-5510 Finance
4369-2234 Gigi Sy 2/3/2018 206-337-0288 Accounting
4369-3979 Kip Hensel 10/6/2020 206-821-4452 Maintenance

Old School 1:
First Last StartDate CellPhone Department
Sioux Chin 10/6/12 206-767-2190 Accounting
Formula in D18: =VLOOKUP($B$5,$B$10:$G$13,COLUMNS($D18:D18)+1,0)
Old School 2:
First Last StartDate CellPhone Department
Sioux Chin 10/6/12 206-767-2190 Accounting
Formula in D24: =INDEX($C$10:$G$13,MATCH($B$5,$B$10:$B$13,0),MATCH(D23,$C$9:$G$
8:D18)+1,0)

13,0),MATCH(D23,$C$9:$G$9,0))
Goal: Lookup employee record based on EmployeeID in cell B5.

EmployeeID First Last StartDate CellPhone Department


4369-9084 ### #NAME? #NAME? #NAME? #NAME?

Formula in D5: {=_xlfn.xlookup(B5,B10:B13,C10:G13)}

EmployeeID First Last StartDate CellPhone Department


4369-9084 Sioux Chin 10/6/2012 206-767-2190 Accounting
4369-4774 Ty Smithe 11/15/2011 435-398-5510 Finance
4369-2234 Gigi Sy 2/3/2018 206-337-0288 Accounting
4369-3979 Kip Hensel 10/6/2020 206-821-4452 Maintenance

Old School 1:
First Last StartDate CellPhone Department
Sioux Chin 10/6/12 206-767-2190 Accounting
Formula in D18: =VLOOKUP($B$5,$B$10:$G$13,COLUMNS($D18:D18)+1,0)
Old School 2:
First Last StartDate CellPhone Department
Sioux Chin 10/6/12 206-767-2190 Accounting
Formula in D24: =INDEX($C$10:$G$13,MATCH($B$5,$B$10:$B$13,0),MATCH(D23,$C$9:$G$
8:D18)+1,0)

13,0),MATCH(D23,$C$9:$G$9,0))
Goal: Lookup column and then aggregate as sum.
Add total units by Day selected in cell C5.

Select Day: Day 1 Formula in C6:


Total Units

Units by Day:

Hour Day 1 Day 2 Day 3 Day 4


6:00 AM 373 1,646 1,606 738
7:00 AM 38 1,198 1,719 1,888
8:00 AM 300 1,828 1,285 816
9:00 AM 1,221 265 484 1,277
10:00 AM 930 780 246 15
11:00 AM 914 227 409 443
12:00 PM 1,271 945 1,924 715
1:00 PM 1,840 617 144 887
2:00 PM 966 1,824 268 378
3:00 PM 672 1,208 1,946 528
4:00 PM 1,177 822 323 760
5:00 PM 304 432 495 364
Old School 1:
First
10,006

Formula in I6: =SUM(INDEX(C11:F22,,MATCH(C5,C10:F10,0)))


Goal: Lookup column and then aggregate as sum.
Add total units by Day selected in cell C5.

Select Day: Day 1 Formula in C6:


Total Units 10,006 =SUM(_xlfn.xlookup(C5,C10:F10,C11:F22))

Units by Day:

Hour Day 1 Day 2 Day 3 Day 4


6:00 AM 373 1,646 1,606 738
7:00 AM 38 1,198 1,719 1,888
8:00 AM 300 1,828 1,285 816
9:00 AM 1,221 265 484 1,277
10:00 AM 930 780 246 15
11:00 AM 914 227 409 443
12:00 PM 1,271 945 1,924 715
1:00 PM 1,840 617 144 887
2:00 PM 966 1,824 268 378
3:00 PM 672 1,208 1,946 528
4:00 PM 1,177 822 323 760
5:00 PM 304 432 495 364
Old School 1:
First
10,006

Formula in I6: =SUM(INDEX(C11:F22,,MATCH(C5,C10:F10,0)))


Goal: Lookup earnings tax rate using "Exact match or next smaller lookup"
Weekly Earnings Tax Rate
$1,200 10.0%
Match?
Retrieve
Lookup Table:
Weekly Earnings
Range of Earnings Tax Rate
Lower Limit
$0 $0 - $299.99 0.0%
$300 $300 - $599.99 2.5%
$600 $600 - $999.99 7.0%
$1,000 $1,000 - $1,999.99 10.0%
$2,000 $2,000 - $4,999.99 position
Corresponding 15.0%
$5,000 $5,000 or more 20.0%

Note: Tax, commission, discount and other similar lookup


tables almost always have the first column sorted A-Z and
almost never contains no duplicates.
Goal: Lookup earnings tax rate using "Exact match or next smaller lookup"
Earnings TaxRate: XLOOKUP Formula in C5:
$1,000

Earnings TaxRate: XLOOKUP (Binary) Formula in C8:


$1,000

Earnings TaxRate: XLOOKUP Formula in C11:


$1,000

Earnings TaxRate: LOOKUP (Binary Search) Formula in C14:


$1,000

Lookup Table:
Earnings Range TaxRate
$0 $0 - $299.99 0.0%
$300 $300 - $599.99 2.5%
$600 $600 - $999.99 7.0%
$1,000 $1,000 - $1,999.99 10.0%
$2,000 $2,000 - $4,999.99 15.0%
$5,000 $5,000 or more 20.0%

Earnings TaxRate Formula in C27:


-$100 Negative Numbers Not Allowed =_xlfn.xlookup(B27,B19:B24,D19:D24,"Negative Numbers Not

Earnings TaxRate Formula in C30:


-$100 0.0% =_xlfn.xlookup(B30,B19:B24,D19:D24,0,-1)

Earnings TaxRate: XLOOKUP Formula in C33:


$1,000 10.0% =MAXIFS(D19:D24,B19:B24,"<="&B33)

Old School 1:
Earnings TaxRate
$1,200 10.0%
10.0%
Formula in C37:
=VLOOKUP(B37,B19:D24,3)
OR
Formula in C38:
=LOOKUP(B37,B19:D24)
< Much Slower calculating, duplicates may yield different answers

< Slower calculating, duplicates may yield different answers

< Much slower calculating, if duplicates will yield same results as LOOKUP

< Easier to create & faster calculation time

9:D24,"Negative Numbers Not Allowed",-1)

< If lookup_array is not sorted and there are no duplicates, this yields
same answer as Exact Match or Next Smaller
Goal: Lookup earnings tax rate using "Exact match or next smaller lookup"
Earnings TaxRate: XLOOKUP Formula in C5:
$1,000 10.0% =_xlfn.xlookup(B5,B19:B24,D19:D24,0,-1)

Earnings TaxRate: XLOOKUP (Binary) Formula in C8:


$1,000 10.0% =_xlfn.xlookup(B8,B19:B24,D19:D24,0,-1,2)

Earnings TaxRate: XLOOKUP Formula in C11:


$1,000 10.0% =_xlfn.xlookup(B11,B19:B24,D19:D24,0,-1,-

Earnings TaxRate: LOOKUP (Binary Search) Formula in C14:


$1,000 10.0% =LOOKUP(B14,B19:D24)

Lookup Table:
Earnings Range TaxRate
$0 $0 - $299.99 0.0%
$300 $300 - $599.99 2.5%
$600 $600 - $999.99 7.0%
$1,000 $1,000 - $1,999.99 10.0%
$2,000 $2,000 - $4,999.99 15.0%
$5,000 $5,000 or more 20.0%

Earnings TaxRate Formula in C27:


-$100 Negative Numbers Not Allowed =_xlfn.xlookup(B27,B19:B24,D19:D24,"Negative Numbers Not

Earnings TaxRate Formula in C30:


-$100 0.0% =_xlfn.xlookup(B30,B19:B24,D19:D24,0,-1)

Earnings TaxRate: XLOOKUP Formula in C33:


$1,000 10.0% =MAXIFS(D19:D24,B19:B24,"<="&B33)

Old School 1:
Earnings TaxRate
$1,200 10.0%
10.0%
Formula in C37:
=VLOOKUP(B37,B19:D24,3)
OR
Formula in C38:
=LOOKUP(B37,B19:D24)
< Much Slower calculating, duplicates may yield different answers

< Slower calculating, duplicates may yield different answers

< Much slower calculating, if duplicates will yield same results as LOOKUP

< Easier to create & faster calculation time

9:D24,"Negative Numbers Not Allowed",-1)

< If lookup_array is not sorted and there are no duplicates, this yields
same answer as Exact Match or Next Smaller
LOOKUP only performs: "Aproximate Match with Binary Search"
First Column MUST always be sorted A-Z
lookup_value lookup_vector = [result_vector] relative position from
argument = search for lookup_value to yield lookup_vector is used to retrieve item from
Item to lookup a relative position. Can be a [result_vector]. Can be a column or a row (not
column or a row (not a table). a table). Does not have to have same
Must be sorted A-Z orientation as lookup_vector

1 LOOKUP(lookup_value, lookup_vector, [result_vector])


2 LOOKUP(lookup_value, array)
lookup_value = array argument = lookup table.
Item to lookup First column must be sorted A-Z. Value is always returned from last column.
If lookup table has number rows >= number of columns, this function does
vertical lookup (retrieves values from last column).
If lookup table has number columns > number of rows, this function does
horizontal lookup (retrieves values from last row).

Note: Use LOOKUP rather than XLOOKUP for tax, commission, discount & other similar lookup tables that
have first column sorted A-Z and where you perform approximate match lookup. LOOKUP takes less time to
create the formula than XLOOKUP and the formula calculates faster than XLOOKUP.
ary Search"

e position from
to retrieve item from
e a column or a row (not
e to have same
_vector

ned from last column.


s, this function does

, this function does

r lookup tables that


KUP takes less time to
Binary Search (Approximate Match) is faster than Linear Search (Exact Match)
Binary Search reduces search time because it repeatedly divides the table in half and checks the one in the middle
to help reduce calc time. It doesn't have to check each one.
For LOOKUP function, here is the idea:
Lookup Returned Vale
27 Above Ave =LOOKUP(C8,C11:D16)

Lookup Returned Vale


0 Poor
15 Below Ave
20 Okay
22 Ave 27>=22 ==> TRUE If this was false, it would take the l
24 Above Ave takes upper half
29 Good and

22 Ave divides in half again


24 Above Ave 27>=24 ==> TRUE
29 Good takes upper half
and

24 Above Ave divides in half again


29 Good 27>=29 ==> FALSE

24 Above Ave ==>> Selects "Above Ave"


cks the one in the middle

this was false, it would take the lower half


LOOKUP & Binary Search calculations steps

Lookup Value: 2
LOOKUP(lv, lookup_table) 5 =LOOKUP(F5,C10:D15)
Lookup Table: Step 1

1 4 1 4
1 6 1 6
2 10 2 10
2 5
3 16 2 5 Checks if 2 (lv) >= 2 (la) and finds that this is TRUE
3 22 3 16 And so it takes the upper values (table on bottom)
3 22

Step 2

2 5

3 16 Checks if 2 (lv) >= 3 (la) and finds that this is FALSE


3 22 And so it takes the lower values (table on top)
Step 3

2 5 This is one row, so LOOKUP returns 5


XLOOKUP & Exact Match or Next Smaller & Search Last To First calculations steps
(Same results as LOOKUP Binary Search, but not a Binary Search and the calculation time is slower than the Binary )

Lookup Value: 2
XLOOKUP(lv,la,ra,,-1,-1) 5 =_xlfn.xlookup(O5,L13:L18,M13:M18,,-1,-1)
Because this is not a Binary Search that requires a sorted lookup_array, the XLOOKUP array-formula-type-algorithm
works something like this:

Lookup Table: Step 1: lv >= lookup_array Step 2: Position of TRUE values?

1 4 1 {=O5>=L13:L18} #NAME? {=IF(_xlfn.anchorarray(O13),_xlfn.sequence(


1 6 1 #NAME?
2 10 1 #NAME?
3 16 0 #NAME?
2 5 1 #NAME?
3 22 0 #NAME?

Step 3:
If the search_mode is Last-to-first, then the max position is used to retrieve a value from the return_array:

Returned Value: ### {=INDEX(M13:M18,MAX(_xlfn.anchorarray(R13)))}


If the search_mode is First-to-last, then the max position is used to retrieve a value from the return_array:

Returned Value: ### {=INDEX(M13:M18,MIN(_xlfn.anchorarray(R13)))}

Algorithmn
First calculations steps XLOOKUP & Exact Match or Next Smaller & Binary Search calculation
ation time is slower than the Binary ) (XLOOKUP Binary Search, but not same results as LOOKUP Binary Search and the calculation

Lookup Value: 2
XLOOKUP(lv,la,ra,,-1,2) 10 =_xlfn.xlookup(Z5,W10:W15,X10:X15,,-1,2)
OOKUP array-formula-type-algorithm Lookup Table: Step 1

1 4 1 4
on of TRUE values? 1 6 1 6
2 10 2 10
{=IF(_xlfn.anchorarray(O13),_xlfn.sequence( 2 5
3 16 2 5
3 22 3 16
3 22

Step 2

1 4
alue from the return_array:
1 6
2 10
alue from the return_array: Step 3

1 4

2 10
ext Smaller & Binary Search calculations steps
esults as LOOKUP Binary Search and the calculation time
is slower than the Binary )

_xlfn.xlookup(Z5,W10:W15,X10:X15,,-1,2)

Checks if 2 (lv) <= 2 (la) and finds that this is TRUE


And so it takes the lower values (table at top)

Checks if 2 (lv) <= 1 (la) and finds that this is FALSE


And so it takes the upper values (bottom at top)

Checks if 2 (lv) <= 2 (la) and finds that this is TRUE


and because this is last row, XLOOKUP returns 10
Goal: Lookup product price.
Product Carlota Product Carlota
Price Price

Formula in C5: Formula in F5:

XLOOKUP can use vertical or horizontal lookup tables:


Product Price Product Aspen Carlota Quad Sunshine
Aspen 26.95 Price 26.95 27.95 43.95 22.95
Carlota 27.95
Quad 43.95
Sunshine 22.95
Yanaki 29.95

Old School: Old School:


Price 27.95 Price 27.95

Formula in C19: =VLOOKUP(C4,B12:C16,2,0) Formula in F19: =HLOOKUP(F4,F11:J12,2,0)


Yanaki
29.95
Goal: Lookup product price.
Product Carlota Product Carlota
Price 27.95 Price 27.95

Formula in C5: =_xlfn.xlookup(C4,B12:B16,C12:C16) Formula in F5: =_xlfn.xlookup(F4,F11:J11,F12:J12)

XLOOKUP can use vertical or horizontal lookup tables:


Product Price Product Aspen Carlota Quad Sunshine
Aspen 26.95 Price 26.95 27.95 43.95 22.95
Carlota 27.95
Quad 43.95
Sunshine 22.95
Yanaki 29.95

Old School: Old School:


Price 27.95 Price 27.95

Formula in C19: =VLOOKUP(C4,B12:C16,2,0) Formula in F19: =HLOOKUP(F4,F11:J12,2,0)


Yanaki
29.95
Goal: Retrieve drain pipe size based on land square footage.

Land Square Footage 23,000 Formula in C5:


Pipe Size Required

Max Land Square Footage


for Pipe Size Drain Pipe Size (in.) Implied category:
238,000 16'' 238,000 >= Pipe Size > 134,000
134,000 12'' 134,000 >= Pipe Size > 83,000
83,000 10'' 83,000 >= Pipe Size > 46,000
46,000 8'' 46,000 >= Pipe Size > 22,000
22,000 6'' 22,000 >= Pipe Size > 14,000
14,000 5'' 14,000 >= Pipe Size > 3,500
3,500 3'' 3,500 >= Pipe Size > 0

Old School 1:
Land Square Footage 23,000 Formula in C20:
Pipe Size Required 8'' =INDEX(C8:C14,MATCH(C19,B8:B14,-1))
C19,B8:B14,-1))
Goal: Retrieve drain pipe size based on land square footage.

Land Square Footage 250,000 Formula in C5:


Pipe Size Required Enter a value equal 238000 or less =_xlfn.xlookup(C4,B8:B14,C8:C14,"Enter a value equ

Max Land Square Footage


for Pipe Size Drain Pipe Size (in.) Implied category:
238,000 16'' 238,000 >= Pipe Size > 134,000
134,000 12'' 134,000 >= Pipe Size > 83,000
83,000 10'' 83,000 >= Pipe Size > 46,000
46,000 8'' 46,000 >= Pipe Size > 22,000
22,000 6'' 22,000 >= Pipe Size > 14,000
14,000 5'' 14,000 >= Pipe Size > 3,500
3,500 3'' 3,500 >= Pipe Size > 0

Old School 1:
Land Square Footage 23,000 Formula in C20:
Pipe Size Required 8'' =INDEX(C8:C14,MATCH(C19,B8:B14,-1))
4,C8:C14,"Enter a value equal "&B8&" or less",1)

C19,B8:B14,-1))
Goal: Lookup Coca Cola and get a match for Coca Cola Inc.
Example of: Wildcard lookup (synonyms: partial text lookup, fuzzy lookup)
* = zero or more characters. ? = a single wildcard characters.

Company (partial
text) City Formula in C7:
Coca

Lookup Table:

Company
(full text) City
Coca Cola Inc. Atlanta
Pepsi Cola Inc. NY
RC Cola KC
Shasta Drinks Calistoga
Old School 1:
Company
(partial text) City
Coca Cola Atlanta

Formula in L7:
=VLOOKUP("*"&K7&"*",B12:C15,2,0)
Goal: Lookup Coca Cola and get a match for Coca Cola Inc.
Example of: Wildcard lookup (synonyms: partial text lookup, fuzzy lookup)
* = zero or more characters. ? = a single wildcard characters.

Company (partial
text) City Formula in C7:
Coca Atlanta =_xlfn.xlookup("*"&B7&"*",B12:B15,C12:C15,,2)

Lookup Table:

Company
(full text) City
Coca Cola Inc. Atlanta
Pepsi Cola Inc. NY
RC Cola KC
Shasta Drinks Calistoga
Old School 1:
Company
(partial text) City
Coca Cola Atlanta

Formula in L7:
=VLOOKUP("*"&K7&"*",B12:C15,2,0)
Goal: Lookup first date worked on project.
"Get First" when there are duplicates = Exact Match Lookup does this by default.

"x" marks when employee worked on project.

First Date
Employee Worked 10/4/2021 10/5/2021 10/6/2021 10/7/2021 10/8/2021
Chin x x x
Gigi #NAME? x x
Sioux #NAME? x x x
Chantel #NAME? x x x x x
Billy #NAME? x x

Formula in C8:

Enter and copy to rows below.

Old School 1:
10/6/2021
Err:509

First Date
Employee Worked 10/4/2021 10/5/2021 10/6/2021 10/7/2021 10/8/2021
Chin #NAME? x x x
Gigi #NAME? x x
Sioux #NAME? x x x
Chantel #NAME? x x x x x
Billy #NAME? x x

New School with LAMBDA:


Err:509
Goal: Lookup first date worked on project.
"Get First" when there are duplicates = Exact Match Lookup does this by default.

"x" marks when employee worked on project.

First Date
Employee Worked 10/4/2021 10/5/2021 10/6/2021 10/7/2021 10/8/2021
Chin 10/6/2021 x x x
Gigi #NAME? x x
Sioux #NAME? x x x
Chantel #NAME? x x x x x
Billy #NAME? x x

Formula in C8:
=_xlfn.xlookup("x",D8:H8,$D$7:$H$7)
Enter and copy to rows below.

Old School 1:
10/6/2021
Err:509

First Date
Employee Worked 10/4/2021 10/5/2021 10/6/2021 10/7/2021 10/8/2021
Chin #NAME? x x x
Gigi #NAME? x x
Sioux #NAME? x x x
Chantel #NAME? x x x x x
Billy #NAME? x x

New School with LAMBDA:


Err:509
Goals: 1) Lookup last sale for each Sales Rep.
"Get Last" when there are duplicates and date column is sorted A-Z.

Date Sales Rep Sales Sales Rep Last Sale Formula in G6:
10/3/2021 Sioux $640.56 Sioux
10/3/2021 Chin $1,706.02 Chin Enter and it spills down to rows below.
10/4/2021 Sioux $1,589.69
10/4/2021 Chin $695.31
10/5/2021 Sioux $474.26 Searching for the position last implies that the table has been sorted
10/5/2021 Chin $786.13
10/6/2021 Sioux $811.12
10/6/2021 Chin $983.25
10/7/2021 Sioux $696.97
10/7/2021 Chin $765.99

Old School on sheet Last(2 ) =>


been sorted
Goals: 1) Lookup last sale for each Sales Rep.
"Get Last" when there are duplicates and date column is sorted A-Z.
Searching for the position last implies that the table has b
Date Sales Rep Sales Sales Rep Last Sale Formula in G6:
10/3/2021 Sioux $640.56 Sioux #NAME? {=_xlfn.xlookup(F6:F7,C6:C15,D6:D15,,,-1)}
10/3/2021 Chin $1,706.02 Chin #NAME? Enter and it spills down to rows below.
10/4/2021 Sioux $1,589.69
10/4/2021 Chin $695.31
10/5/2021 Sioux $474.26
10/5/2021 Chin $786.13
10/6/2021 Sioux $811.12
10/6/2021 Chin $983.25
10/7/2021 Sioux $696.97
10/7/2021 Chin $765.99
Old School:
Sales Rep Last Sale Formula in G18:
Sioux 696.97 {=INDEX($D$6:$D$15,MATCH(MAX(IF($C$6:$C$15=F18,$B
Chin 765.99 Copy Down
mplies that the table has been sorted

AX(IF($C$6:$C$15=F18,$B$6:$B$15))&F18,$B$6:$B$15&$C$6:$C$15,0))}
Goals: 1) Lookup last sale for each sales rep, then 2) lookup up last date each Sales Rep made a sale.
"Get Last" when there are duplicates.
If Data Set Will NOT Be Sorted and there are no duplicat
Date Sales Rep Sales Sales Rep Last Sale Formula in G6:
10/3/2021 Sioux $640.56 Sioux #NAME? {=_xlfn.xlookup(F6:F7,C6:C15,D6:D15,,,-1)}
10/3/2021 Chin $1,706.02 Chin #NAME? Enter and it spills down to rows below.
10/4/2021 Sioux $1,589.69
10/4/2021 Chin $695.31 If you know there are no duplicate sales for a given day:
10/5/2021 Sioux $474.26 Sales Rep Last Sale Formula in G11:
10/5/2021 Chin $786.13 Sioux 696.97 {=SUMIFS(D6:D15,B6:B15,MAXIFS(B6:B15,C6:C15,F11:F12
10/6/2021 Sioux $811.12 Chin 765.99 Enter and it spills down to rows below.
10/6/2021 Chin $983.25
10/7/2021 Sioux $696.97
10/7/2021 Chin $765.99 Sales Rep Last Date Formula in G16:
Sioux 10/7/2021 {=MAXIFS(B6:B15,C6:C15,F16:F17)}
Chin 10/7/2021 Enter and it spills down to rows below.

If you have a way of marking the last, like with a unique


Sales Rep Last Sale Formula in G21:
Sioux #NAME? {=_xlfn.xlookup(MAXIFS(B6:B15,C6:C15,F21:F22)&F21:F22
Chin #NAME? Enter and it spills down to rows below.

Old School 1:
Sales Rep Last Sale Formula in G26:
Sioux 696.97 {=INDEX($D$6:$D$15,MATCH(MAX(IF($C$6:$C$15=F26,$
Chin 765.99 Copy Down

Old School 2:
Sales Rep Last Sale Formula in G31:
Sioux 696.97 {=SUMIFS($D$6:$D$15,$B$6:$B$15,MAX(IF($C$6:$C$15=
Chin 765.99 Copy Down
and there are no duplicate matches for SalesRep and Date!!!

6:D15,,,-1)}

cate sales for a given day:

IFS(B6:B15,C6:C15,F11:F12),C6:C15,F11:F12)}

he last, like with a unique date, then:

5,C6:C15,F21:F22)&F21:F22,B6:B15&C6:C15,D6:D15)}

MAX(IF($C$6:$C$15=F26,$B$6:$B$15))&F26,$B$6:$B$15&$C$6:$C$15,0))}

B$15,MAX(IF($C$6:$C$15=F31,$B$6:$B$15)),$C$6:$C$15,F31)}
Goal: Lookup price based on product & store.
Two value lookup to determine price.
Old School 1:
Store Seattle Store Seattle
Product Quad Product Quad
Price Price 39.95

Formula in C7: Formula in J7:


{=INDEX(D13:D21,MATCH(J5&J6,B13:B21&C1

Store Product Price


Oakland Quad 43.95
Oakland Aspen 27.95
Oakland Carlota 25.95
Seattle Quad 39.95
Seattle Aspen 24.95
Seattle Carlota 26.95
Tacoma Quad 30.95
Tacoma Aspen 27.95
Tacoma Carlota 25.95
Store Product
#NAME? #NAME?
#NAME? #NAME?
#NAME? #NAME?

ATCH(J5&J6,B13:B21&C13:C21,0))}
Goal: Lookup price based on product & store.
Two value lookup to determine price.
Old School 1:
Store Seattle Store Seattle
Product Quad Product Quad
Price #NAME? Price 39.95

Formula in C7: Formula in J7:


{=_xlfn.xlookup(C5&C6,B13:B21&C13:C21,D13:D21)} {=INDEX(D13:D21,MATCH(J5&J6,B13:B21&C1

Store Product Price


Oakland Quad 43.95
Oakland Aspen 27.95
Oakland Carlota 25.95
Seattle Quad 39.95
Seattle Aspen 24.95
Seattle Carlota 26.95
Tacoma Quad 30.95
Tacoma Aspen 27.95
Tacoma Carlota 25.95
Store Product
#NAME? #NAME?
#NAME? #NAME?
#NAME? #NAME?

ATCH(J5&J6,B13:B21&C13:C21,0))}
Goal: Lookup federal income tax deduction based on gross pay and allowances.
Perform 2-way look, with row header & column header determining intersecting lookup value.

SINGLE Person—WEEKLY Payroll Period


If the gross pay is: And the number of withholding allowances claimed is—
But less 0 1 2 3 4 5
At least
than The amount of income tax to be withheld is—
450 460 31 20 12 4 0 0
460 470 33 22 13 5 0 0
470 480 34 23 14 6 0 0
680 690 66 55 44 33 22 13
690 700 67 56 45 34 23 14
700 710 68 57 45 34 23 14
710 720 69 58 46 35 23 15

Gross Pay 705


Allowance 0
Lookup Column First => Fed Tax Deduction Err:509
Lookup Row First => Fed Tax Deduction #NAME? Err:509

Old School 1: Fed Tax Deduction 68 Err:509


Old School 2: Fed Tax Deduction 68 Err:509
Old & New School: Fed Tax Deduction 68 Err:509
tersecting lookup value.

6 7

0 0
0 0
0 0
0 0
0 0
0 0
0 0
Goal: Lookup federal income tax deduction based on gross pay and allowances.
Perform 2-way look, with row header & column header determining intersecting lookup value.

SINGLE Person—WEEKLY Payroll Period


If the gross pay is: And the number of withholding allowances claimed is—
But less 0 1 2 3 4 5
At least
than The amount of income tax to be withheld is—
450 460 31 20 12 4 0 0
460 470 33 22 13 5 0 0
470 480 34 23 14 6 0 0
480 490 36 25 15 7 1 0
490 500 37 26 16 8 2 0
500 510 39 28 17 9 3 0
710 720 69 58 46 35 23 15
Gross Pay 705
Allowance 0
Lookup Column First => Fed Tax Deduction #NAME? Err:509
Lookup Row First => Fed Tax Deduction #NAME? Err:509

Old School 1: Fed Tax Deduction 68 Err:509


Old School 2: Fed Tax Deduction 68 Err:509
Old & New School: Fed Tax Deduction 68 Err:509
tersecting lookup value.

6 7

0 0
0 0
0 0
0 0
0 0
0 0
0 0
Goal: Extract student class records.
Famous Excel task: One lookup value, return multiple items/records.
Student Class Department Grade Student
Sioux Chin Acc 121 Accounting 1.7 Chantel Mimms
Chantel Mimms Busn 216 Business 3.1
Dylan Franks Busn 101 Business 2.1 Class Department Grade Formula in G9:
Sioux Chin Acc 201 Accounting 4
Chantel Mimms Busn 218 Business 3.8
Dylan Franks Eng 201 English 2
Sioux Chin Econ 201 Economics 2.6
Chantel Mimms Busn 210 Business 3.3
Dylan Franks Busn 216 Business 1.9 Class Department Grade
Gigi Dmitri Busn 210 Business 2.6 Busn 216 Business 3.1
Chantel Mimms Eng 201 English 3.1 Busn 218 Business 3.8
Gigi Dmitri Econ 202 Economics 2 Busn 210 Business 3.3
Eng 201 English 3.1
Formula 'before we had FILTER' in G15:
Formula in G9:

Err:509
Student
#NAME?
#NAME?
#NAME?
#NAME?
Goal: Extract student class records.
Famous Excel task: One lookup value, return multiple items/records.

Student Class Department Grade Student


Sioux Chin Acc 121 Accounting 1.7 Gigi Dmitri
Chantel Mimms Busn 216 Business 3.1
Dylan Franks Busn 101 Business 2.1 Class Department Grade Formula in G9:
Sioux Chin Acc 201 Accounting 4 #NAME? #NAME? ### {=_xlfn._xlws.filter(C6:E
Chantel Mimms Busn 218 Business 3.8 #NAME? #NAME? ###
Dylan Franks Eng 201 English 2
Sioux Chin Econ 201 Economics 2.6
Chantel Mimms Busn 210 Business 3.3
Dylan Franks Busn 216 Business 1.9 Class Department Grade
Gigi Dmitri Busn 210 Business 2.6 Busn 210 Business 2.6
Chantel Mimms Eng 201 English 3.1 Econ 202 Economics 2
Gigi Dmitri Econ 202 Economics 2

Formula 'before we had FILTER' in G15:


Formula in G9:
{=_xlfn._xlws.filter(C6:E17,B6:B17=G6)}

Err:509
Student
#NAME?
#NAME?
#NAME?
#NAME?
lookup_array argument =
lookup_value search for lookup_value to yield
argument = a relative position. Can be a [match_mode] and [search_mode]
item to lookup column or a row (not a table) arguments = same as XLOOKUP

XMATCH(lookup_value, lookup_array, [match_mode], [search_mode])

What does XMATCH do?


It reports the relative position of an item in a list.
Example: XMATCH looks up "Quad" in the array {"Fast","Quad","Sunset"}, and reports that it is in position 2.
is in position 2.
Goal: Are names in Sunday list also in the Saturday list?
Saturday List Sunday List
Signups Sat. Event Signups Sun. Event In Both? Formula in E7:
Ty Miki
Gigi Gigi
Sioux Kip
Chantel Chantel
Fran

Goal: Are names in Sunday list NOT in the Saturday list?

Saturday List Sunday List

Signups Sat. Event Signups Sun. Event Only Sunday Formula in E18:
Ty Miki
Gigi Gigi
Sioux Kip
Chantel Chantel
Fran

#N/A
Goal: Are names in Sunday list also in the Saturday list?

Saturday List Sunday List Are Items in Both Lists?


Signups Sat. Event Signups Sun. Event In Both? Formula in E7:
Ty Miki 0 {=ISNUMBER(_xlfn.xmatch(D7:D11,B7:B10))}
Gigi Gigi 0
Sioux Kip 0
Chantel Chantel 0
Fran 0

Goal: Are names in Sunday list NOT in the Saturday list?

Saturday List Sunday List Are Items From This List In The Other List?
Signups Sat. Event Signups Sun. Event In Both? Formula in E18:
Ty Miki 0 {=ISNA(_xlfn.xmatch(D18:D22,B18:B21))}
Gigi Gigi 0
Sioux Kip 0
Chantel Chantel 0
Fran 0
n The Other List?
value1 result1
expression argument = argument =
argument = match against if value1 = expression,
lookup_value lookup_value this is result to return

SWITCH(expression, value1, result1, [default_or_value2, results2], …)

What does SWITCH Do?


SWITCH function's super power is that is can lookup anything: numbers, text values, formulas, tables,
cell references, ranges, arrays and much more!
Example: Lookup tables.
[default_or_value2, result2]
argument =
pression, continue with value and
o return result, or put default

efault_or_value2, results2], …)

nything: numbers, text values, formulas, tables,


cell references, ranges, arrays and much more!
Goal:
1) With SWITCH function, lookup correct lookup table based on product name.
2) Then use SWITCH result in the LOOKUP function to perform lookup for Unit "Exact Match or Next Smaller with Binary Sea
Units Transaction Table:

Price
Product Price Units Sold Discount Bellen Units P. Discount
Bellen 26.95 24 0 0%
Aspen 28.95 60 15 25%
Bellen 26.95 50 45 40%
Quad 43.95 5
Quad 43.95 25 Quad Units P. Discount
Bellen 26.95 96 0 0%
Yanaki 30.95 8 20 20%
Quad 43.95 124 60 45%
Bellen 26.95 55
Bellen 26.95 2 Default Units P. Discount
Quad 43.95 5 0 0%
Yanaki 30.95 19 15 30%
25 50%
atch or Next Smaller with Binary Search"
IFS is longer formula

Price
Discount
0.25
0.5
0.4
0
0.2
0.4
0
0.45
0.4
0
0
0.3
Goal:
1) With SWITCH function, lookup correct lookup table based on product name.
2) Then use SWITCH result in the LOOKUP function to perform lookup for Unit "Exact Match or Next Smaller with Binary Sea
Units Transaction Table: IFS is longer formula

Price Price
Product Price Units Sold Discount Bellen Units P. Discount Discount
Bellen 26.95 24 0.25 0 0% 0.25
Aspen 28.95 60 0.5 15 25% 0.5
Bellen 26.95 50 0.4 45 40% 0.4
Quad 43.95 5 0 0
Quad 43.95 25 0.2 Quad Units P. Discount 0.2
Bellen 26.95 96 0.4 0 0% 0.4
Yanaki 30.95 8 0 20 20% 0
Quad 43.95 124 0.45 60 45% 0.45
Bellen 26.95 55 0.4 0.4
Bellen 26.95 2 0 Default Units P. Discount 0
Quad 43.95 5 0 0 0% 0
Yanaki 30.95 19 0.3 15 30% 0.3
25 50%

Formula in E9:=LOOKUP(D9,SWITCH(B9,$G$8,$I$9:$J$11,$G$13,$I$14:$J$16,$I$19:$J$21))
h or Next Smaller with Binary Search"
S is longer formula Dynamic Spilled Array

Price
Discount
Err:504
Err:504
Err:504
Err:504
Err:504
Err:504
Err:504
Err:504
Err:504
Err:504
Err:504
Err:504

,$I$19:$J$21))
Goal: "Approximate match" lookup when 1st column sorted & we want item from last column.
Advantage: Enter fewer arguments, as compared to XLOOKUP. Faster to create formula with LOOKUP.

Pay Already Taxed - Cumulative Tax Paid


Taxable Pay Taxable Pay Tax Upper Limit Previous From Previous
Lower Limit Upper Limit Rate Category Categories
$0.00 $222 0% $0 $0.00
$222.01 $588 10% $222 $0.00
$588.01 $1,711 12% $588 $36.60
$1,711.01 $3,395 22% $1,711 $171.36
$3,395.01 $6,280 24% $3,395 $541.84
$6,280.01 $7,914 32% $6,280 $1,234.24
$7,914.01 $11,761 35% $7,914 $1,757.12
$11,761.01 more 37% $11,761 $3,103.57

If we make calculation manually: $541.84 + ($3,690.80 - $3,395) * 24% = $612.83


Gross Pay $4,010.00
Withholding Allowance $79.80
# of Withholding Allowances 4
Taxable Pay (TP). This is lookup_value: $3,690.80
Federal Income Tax Withholdings?
Federal Income Tax Withholdings? $612.83

Formula in F22:=_xlfn.xlookup(F20,B6:B13,F6:F13,,-1)+(F20-_xlfn.xlookup(F20,B6:B13,E6:E13,,-1))
*_xlfn.xlookup(F20,B6:B13,D6:D13,,-1)
want item from last column.
ster to create formula with LOOKUP.

Tax Rule in Full:

$0.00 +(TP - $222) *10%


$36.60 +(TP - $588) *12%
$171.36 +(TP - $1,711) *22%
$541.84 +(TP - $3,395) *24% Tax Paid + (TP - Pay Alread Taxed)*TaxRate
$1,234.24 +(TP - $6,280) *32%
$1,757.12 +(TP - $7,914) *35%
$3,103.57 +(TP - $11,761) *37%

$3,395) * 24% = $612.83

Tax Paid + (TP - Pay Alread Taxed)*TaxRate

0-_xlfn.xlookup(F20,B6:B13,E6:E13,,-1))
Goal: "Approximate match" lookup when 1st column sorted & we want item from last column.
Advantage: Enter fewer arguments, as compared to XLOOKUP. Faster to create formula with LOOKUP.

Pay Already Taxed - Cumulative Tax Paid


Taxable Pay Taxable Pay Tax Upper Limit From Previous
Lower Limit Upper Limit Rate Previous Category Categories
$0.00 $222 0% $0 $0.00
$222.01 $588 10% $222 $0.00
$588.01 $1,711 12% $588 $36.60
$1,711.01 $3,395 22% $1,711 $171.36
$3,395.01 $6,280 24% $3,395 $541.84
$6,280.01 $7,914 32% $6,280 $1,234.24
$7,914.01 $11,761 35% $7,914 $1,757.12
$11,761.01 more 37% $11,761 $3,103.57

If we make calculation manually: $541.84 + ($3,690.80 - $3,395) * 24% = $612.83


Gross Pay $4,010.00
Withholding Allowance $79.80
# of Withholding Allowances 4
Taxable Pay (TP). This is lookup_value: $3,690.80
Federal Income Tax Withholdings? $612.83
Federal Income Tax Withholdings? $612.83
Formula in F21:=LOOKUP(F20,B6:F13)+(F20-LOOKUP(F20,B6:E13))*LOOKUP(F20,B6:D13)
Formula in F22:=_xlfn.xlookup(F20,B6:B13,F6:F13,,-1)+(F20-_xlfn.xlookup(F20,B6:B13,E6:E13,,-
1))
*_xlfn.xlookup(F20,B6:B13,D6:D13,,-1)
we want item from last column.
Faster to create formula with LOOKUP.

Tax Rule in Full:

$0.00 +(TP - $222) *10%


$36.60 +(TP - $588) *12%
$171.36 +(TP - $1,711) *22%
$541.84 +(TP - $3,395) *24% Tax Paid + (TP - Pay Alread Taxed)*TaxRate
$1,234.24 +(TP - $6,280) *32%
$1,757.12 +(TP - $7,914) *35%
$3,103.57 +(TP - $11,761) *37%

0 - $3,395) * 24% = $612.83

Tax Paid + (TP - Pay Alread Taxed)*TaxRate

0,B6:E13))*LOOKUP(F20,B6:D13)
F20-_xlfn.xlookup(F20,B6:B13,E6:E13,,-
Homework, Practice Problems on Following Worksheets ==>>
Blue = Work on.
Red = Solution.
Goals: Add a Data Validation dropdown list to cell B6 based on the E-mails in the range G11:G17.
In cell C8, create a formula to lookup Employee ID based on the e-mail in cell B6.

E-mail
[email protected]

Employee ID:

Employee ID First Last Start Date E-mail Start Position BirthDate


880-245-3400 Jo Jones 11/22/2010 [email protected] C1 11/27/1990
880-245-3401 Mo Abdi 10/31/2014 [email protected] A1 11/8/1983
880-245-3402 Phil Kips 12/23/2015 [email protected] A1 12/30/1986
880-245-3403 Ty Mimms 1/31/2016 [email protected] C1 2/6/1989
880-245-3404 Lin Chinn 2/1/2016 [email protected] D1 2/9/1963
880-245-3405 Hien Pham 8/24/2017 [email protected] A1 9/3/1978
880-245-3406 Sam Fix 8/9/2018 [email protected] D2 8/14/1997
Formula in cell C8:
Goals: Add a Data Validation dropdown list to cell B6 based on the Employee IDs in the range B11:B17.
In cell C8, create a formula to lookup the full record for the Employee ID selected in cell B6.

Employee ID
880-245-3404

Lookup Record:

Employee ID First Last Start Date E-mail Start Position BirthDate


880-245-3400 Jo Jones 11/22/2010 [email protected] C1 11/27/1990
880-245-3401 Mo Abdi 10/31/2014 [email protected] A1 11/8/1983
880-245-3402 Phil Kips 12/23/2015 [email protected] A1 12/30/1986
880-245-3403 Ty Mimms 1/31/2016 [email protected] C1 2/6/1989
880-245-3404 Lin Chinn 2/1/2016 [email protected] D1 2/9/1963
880-245-3405 Hien Pham 8/24/2017 [email protected] A1 9/3/1978
880-245-3406 Sam Fix 8/9/2018 [email protected] D2 8/14/1997
Formula in cell C8:
Goals: In the grade column create the % Grade for each student.
In the Decimal Grade column create formula to lookup the correct decimal grade.

Max Points for Class: 650

Student Score for class % Grade Decimal Grade Decimal Grade % Grade
Abdi Linberger 491 0
Kip Berkeley 404 0.62
Gigi Pham 525 0.63
Chantel Mimms 632 0.64
Fred Dean 566 0.65
Dino Hipster 45 0.66
Tyrone Spawn 612 0.67
0.68
0.69
0.7
0.71
0.72
0.73
0.74
0.75
0.76
0.77
0.78
0.79
0.8
0.81
0.82
0.83
0.84
0.85
0.86
0.87
0.88
0.89
0.9
0.91
0.92
0.93
0.94
0.95
Decimal Grade
0 Formula in cell D8:
0.7
0.8
0.9
1 Formula in cell E8:
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
2
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
3
3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9
4
Goals: Create a lookup formula in the commission column that can
lookup the commission bonus based on the employee's sales.
Create the formula two different ways. Hint: This is an Excel Table so you can not spill a formula.

Employee Sales Commission Bonus Commission Bonus2 Sales


Akilah Delaney 338,922 $0
Asa Crain 230,965 $125,000
Vern Coppola 210,205 $175,000
Sharilyn Mahaffey 221,499 $225,000
Jackson Rizzo 215,074 $275,000
Sarina Parnell 131,933 $325,000
Kenyatta Ferrell 197,045
Tristan Sanborn 145,586
Melodi Buffington 127,485
Brianne Friedman 129,849
Mardell Burrow 243,443
Myong Garvin 332,738
Celinda Trahan 133,377
Kandi Evers 166,646
Annmarie Cornell 135,315
Jesenia Nagy 166,457
Asuncion France 252,302
Tyesha Forbes 203,481
Marquis Beaty 320,568
Donte Haskins 104,880
Monika Hager 256,265
Pok Felix 345,739
Ena Sales 335,257
Dinorah Calloway 241,899
Augustine Hartwell 270,807
Allene Gleason 303,942
Erin Dupree 285,297
Temika Weis 232,707
Stephen Witherspoon 194,567
Breann Dang 220,643
Arlette Dancy 214,056
Etsuko Redd 255,475
Kyoko Kunz 119,668
Hedy Coles 162,139
Tifany Walling 118,109
Tabatha Sorensen 348,634
Cathern Hostetler 102,540
Chau Schmitt 132,372
Bernetta Ontiveros 146,861
Malcom Lovejoy 341,909
Nikki Dominguez 336,782
Porsha Caudle 178,736
Florentina Hummel 101,658
Winter Etheridge 318,570
Val Duvall 253,992
Elfrieda Fairley 154,237
Maud Singletary 239,926
Maryjo Ybarra 342,890
Shane Southern 309,112
Felice Cherry 158,108
Commission
Bonus Formula in cell D7:
$0
$750
$1,250
$2,000 Formula in cell E7:
$3,000
$3,750
Goals: In cell C5 create lookup formula to look up correct Vent Size based on Room Sq. Ft.

Room Sq. Ft. 414 Room Sq. Ft. Vent Size (inch)
Vent Size: 0 6
5 8
Hint: use "Exact match or next larger" lookup. 20 12
100 14
200 16
300 20
500 25
700 30
Formula in cell C5:
Goals: In cell C5 create formula to add the total calls for the month name in cell C4.

Month Dec Calls by Month:


Total Calls:
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
145 23 133 163 164 112 161 93 125 115 51 86
117 51 76 161 123 95 21 107 131 56 111 84
160 40 123 131 50 144 103 84 13 48 121 89
88 66 52 148 44 151 139 70 106 101 161 94
69 88 135 23 151 140 19 49 169 103 100 55
88 74 83 129 91 146 30 129 137 21 146 40
93 87 161 168 97 158 16 8 137 125 133 28
84 147 107 141 18 126 129 64 159 122 85 92
64 47 129 24 138 153 105 94 45 64 37 139
15 56 119 135 143 76 127 129 161 109 109 16
166 135 10 123 28 115 129 25 127 109 67 24
109 106 128 66 99 68 41 85 15 44 35 53
122 112 79 63 105 114 52 143 48 75 40 53
156 142 134 126 85 33 44 117 56 67 95 37
54 44 99 87 31 100 84 75 144 92 54 12
154 16 74 13 166 86 156 53 76 119 17 48
89 99 70 159 106 65 107 91 50 26 165 39
90 93 57 104 139 95 163 119 26 99 24 12
50 143 52 152 84 129 141 35 145 11 144 28
104 26 154 98 59 125 144 4 147 59 105 30
111 62 58 24 42 138 147 58 83 54 63 14
100 104 115 20 128 71 63 22 106 41 65 18
215 89 113 72 168 91 22 53 132 84 127 12
287 105 47 123 37 73 83 10 45 97 89 21
Formula in cell C5:
Goals: Create formula in cell G8 to extract and spill names in Winter 2020 class that are not in Fall 2020 class:
Add conditional formatting to spilled range that adds a border and green fill if the cell shows a spilled value.

Accounting 121 Class Accounting 121 Class

Fall Winter
2020 2020
Temika Weis Cheryl Estrada
Stephen Witherspoon Judy Douglas
Breann Dang Wade Grant
Arlette Dancy Isaac Owens
Etsuko Redd Luz Caldwell
Kyoko Kunz Lynette Harmon
Hedy Coles Carl Stokes
Tifany Walling Maggie Ortega
Tabatha Sorensen Allison Stevenson
Cathern Hostetler Mathew Weber
Chau Schmitt Breann Dang
Bernetta Ontiveros Cathern Hostetler
Malcom Lovejoy Porsha Caudle
Nikki Dominguez Joshua Pratt
Porsha Caudle Edgar Ferguson
Florentina Hummel Cesar Dunn
Luz Caldwell Allan Nguyen
Judy Douglas Roderick Mendez
Blanche Stanley
class that are not in Fall 2020 class:
fill if the cell shows a spilled value.

Extract names in Winter 2020 class that


are not in Fall 2020 class: Formula in cell G8:
Goals: Create formula to extract records for World Series Games from the start year in cell C7 to the end year in cell C8.
Solve this problem in two ways:
1) In cell G13 spill the result using the FILTER function.

Start Year: 1970


End Year: 1979 Formula in cell G12:

Baseball World Series Teams from 1903 to 2019:

Year Winning team Losing team Games Year


1903 Boston Americans Pittsburgh Pirates 5–3
1904 No World Series No World Series No WS
1905 New York Giants Philadelphia Athletics 4–1
1906 Chicago White Sox Chicago Cubs 4–2
1907 Chicago Cubs Detroit Tigers 4–0–(1)
1908 Chicago Cubs Detroit Tigers 4–1
1909 Pittsburgh Pirates Detroit Tigers 4–3
1910 Philadelphia Athletics Chicago Cubs 4–1
1911 Philadelphia Athletics New York Giants 4–2
1912 Boston Red Sox New York Giants 4–3–(1)
1913 Philadelphia Athletics New York Giants 4–1
1914 Boston Braves Philadelphia Athletics 4–0
1915 Boston Red Sox Philadelphia Phillies 4–1
1916 Boston Red Sox Brooklyn Robins 4–1
1917 Chicago White Sox New York Giants 4–2
1918 Boston Red Sox Chicago Cubs 4–2
1919 Cincinnati Reds Chicago White Sox 5–3
1920 Cleveland Indians Brooklyn Robins 5–2
1921 New York Giants New York Yankees 5–3
1922 New York Giants New York Yankees 4–0–(1)
1923 New York Yankees New York Giants 4–2
1924 Washington Senators New York Giants 4–3
1925 Pittsburgh Pirates Washington Senators 4–3
1926 St. Louis Cardinals New York Yankees 4–3
1927 New York Yankees Pittsburgh Pirates 4–0
1928 New York Yankees St. Louis Cardinals 4–0
1929 Philadelphia Athletics Chicago Cubs 4–1
1930 Philadelphia Athletics St. Louis Cardinals 4–2
1931 St. Louis Cardinals Philadelphia Athletics 4–3
1932 New York Yankees Chicago Cubs 4–0
1933 New York Giants Washington Senators 4–1
1934 St. Louis Cardinals Detroit Tigers 4–3
1935 Detroit Tigers Chicago Cubs 4–2
1936 New York Yankees New York Giants 4–2
1937 New York Yankees New York Giants 4–1
1938 New York Yankees Chicago Cubs 4–0
1939 New York Yankees Cincinnati Reds 4–0
1940 Cincinnati Reds Detroit Tigers 4–3
1941 New York Yankees Brooklyn Dodgers 4–1
1942 St. Louis Cardinals New York Yankees 4–1
1943 New York Yankees St. Louis Cardinals 4–1
1944 St. Louis Cardinals St. Louis Browns 4–2
1945 Detroit Tigers Chicago Cubs 4–3
1946 St. Louis Cardinals Boston Red Sox 4–3
1947 New York Yankees Brooklyn Dodgers 4–3
1948 Cleveland Indians Boston Braves 4–2
1949 New York Yankees Brooklyn Dodgers 4–1
1950 New York Yankees Philadelphia Phillies 4–0
1951 New York Yankees New York Giants 4–2
1952 New York Yankees Brooklyn Dodgers 4–3
1953 New York Yankees Brooklyn Dodgers 4–2
1954 New York Giants Cleveland Indians 4–0
1955 Brooklyn Dodgers New York Yankees 4–3
1956 New York Yankees Brooklyn Dodgers 4–3
1957 Milwaukee Braves New York Yankees 4–3
1958 New York Yankees Milwaukee Braves 4–3
1959 Los Angeles Dodgers Chicago White Sox 4–2
1960 Pittsburgh Pirates New York Yankees 4–3
1961 New York Yankees Cincinnati Reds 4–1
1962 New York Yankees San Francisco Giants 4–3
1963 Los Angeles Dodgers New York Yankees 4–0
1964 St. Louis Cardinals New York Yankees 4–3
1965 Los Angeles Dodgers Minnesota Twins 4–3
1966 Baltimore Orioles Los Angeles Dodgers 4–0
1967 St. Louis Cardinals Boston Red Sox 4–3
1968 Detroit Tigers St. Louis Cardinals 4–3
1969 New York Mets Baltimore Orioles 4–1
1970 Baltimore Orioles Cincinnati Reds 4–1
1971 Pittsburgh Pirates Baltimore Orioles 4–3
1972 Oakland Athletics Cincinnati Reds 4–3
1973 Oakland Athletics New York Mets 4–3
1974 Oakland Athletics Los Angeles Dodgers 4–1
1975 Cincinnati Reds Boston Red Sox 4–3
1976 Cincinnati Reds New York Yankees 4–0
1977 New York Yankees Los Angeles Dodgers 4–2
1978 New York Yankees Los Angeles Dodgers 4–2
1979 Pittsburgh Pirates Baltimore Orioles 4–3
1980 Philadelphia Phillies Kansas City Royals 4–2
1981 Los Angeles Dodgers New York Yankees 4–2
1982 St. Louis Cardinals Milwaukee Brewers 4–3
1983 Baltimore Orioles Philadelphia Phillies 4–1
1984 Detroit Tigers San Diego Padres 4–1
1985 Kansas City Royals St. Louis Cardinals 4–3
1986 New York Mets Boston Red Sox 4–3
1987 Minnesota Twins St. Louis Cardinals 4–3
1988 Los Angeles Dodgers Oakland Athletics 4–1
1989 Oakland Athletics San Francisco Giants 4–0
1990 Cincinnati Reds Oakland Athletics 4–0
1991 Minnesota Twins Atlanta Braves 4–3
1992 Toronto Blue Jays Atlanta Braves 4–2
1993 Toronto Blue Jays Philadelphia Phillies 4–2
1994 No World Series No World Series No WS
1995 Atlanta Braves Cleveland Indians 4–2
1996 New York Yankees Atlanta Braves 4–2
1997 Florida Marlins Cleveland Indians 4–3
1998 New York Yankees San Diego Padres 4–0
1999 New York Yankees Atlanta Braves 4–0
2000 New York Yankees New York Mets 4–1
2001 Arizona Diamondbacks New York Yankees 4–3
2002 Anaheim Angels San Francisco Giants 4–3
2003 Florida Marlins New York Yankees 4–2
2004 Boston Red Sox St. Louis Cardinals 4–0
2005 Chicago White Sox Houston Astros 4–0
2006 St. Louis Cardinals Detroit Tigers 4–1
2007 Boston Red Sox Colorado Rockies 4–0
2008 Philadelphia Phillies Tampa Bay Rays 4–1
2009 New York Yankees Philadelphia Phillies 4–2
2010 San Francisco Giants Texas Rangers 4–1
2011 St. Louis Cardinals Texas Rangers 4–3
2012 San Francisco Giants Detroit Tigers 4–0
2013 Boston Red Sox St. Louis Cardinals 4–2
2014 San Francisco Giants Kansas City Royals 4–3
2015 Kansas City Royals New York Mets 4–1
2016 Chicago Cubs Cleveland Indians 4–3
2017 Houston Astros Los Angeles Dodgers 4–3
2018 Boston Red Sox Los Angeles Dodgers 4–1
2019 Washington Nationals Houston Astros 4–3
art year in cell C7 to the end year in cell C8.

Formula in cell G12:

Winning team Losing team Games


Goals: In cell H7, spill the records for the product listed in cell I4.

Date Sales Web Site Product Time Product: Quad


1/30/21 Amazon Amazon Quad 1:00 AM
1/27/21 Gel.com Amazon Quad 10:24 PM Date Sales Web Site Product
1/24/21 Boom.com Amazon Aspen 7:18 PM
1/4/21 Amazon Amazon Carlota 5:54 PM
1/14/21 E-Bay Amazon Aspen 12:24 PM
1/22/21 Gel.com Amazon Quad 5:06 PM
1/18/21 E-Bay Amazon Yanaki 11:06 AM
1/22/21 Boom.com Amazon Yanaki 6:24 AM
1/9/21 Boom.com Amazon Quad 2:30 PM
1/5/21 Amazon Amazon Carlota 5:36 PM
1/18/21 Amazon Amazon Carlota 9:36 AM
1/28/21 Boom.com Amazon Yanaki 7:48 PM
1/8/21 Amazon Amazon Carlota 7:42 PM
1/7/21 E-Bay Amazon Yanaki 4:54 AM
1/15/21 Gel.com Amazon Yanaki 1:36 PM
1/3/21 Amazon Amazon Yanaki 1:00 AM
1/25/21 E-Bay Amazon Yanaki 3:54 AM
1/20/21 Gel.com Amazon Quad 3:36 AM
1/6/21 Gel.com Amazon Quad 2:36 AM
1/8/21 E-Bay Amazon Carlota 11:18 PM
1/13/21 Gel.com Amazon Carlota 7:30 PM
1/12/21 Boom.com Amazon Yanaki 7:00 PM
1/4/21 E-Bay Amazon Quad 6:42 AM
1/29/21 Boom.com Amazon Yanaki 8:48 PM
1/4/21 Gel.com Amazon Yanaki 4:48 PM
1/11/21 Gel.com Amazon Carlota 2:48 PM
1/18/21 Gel.com Amazon Carlota 3:36 PM
1/21/21 Amazon Amazon Yanaki 12:18 AM
1/10/21 Gel.com Amazon Aspen 6:30 PM
1/7/21 Boom.com Amazon Aspen 7:00 PM
1/29/21 Amazon Amazon Yanaki 7:24 AM
1/13/21 Gel.com Amazon Carlota 8:18 PM
1/30/21 E-Bay Amazon Yanaki 10:36 PM
1/20/21 Amazon Amazon Yanaki 9:42 PM
1/7/21 Amazon Amazon Quad 5:06 PM
1/1/21 Gel.com Amazon Yanaki 7:36 AM
1/30/21 Amazon Amazon Quad 5:30 PM
1/15/21 E-Bay Amazon Yanaki 2:24 PM
1/7/21 Boom.com Amazon Carlota 5:48 PM
1/9/21 E-Bay Amazon Quad 10:18 PM
1/4/21 Boom.com Amazon Carlota 6:36 AM
1/30/21 Gel.com Amazon Carlota 7:48 AM
1/3/21 Gel.com Amazon Quad 3:00 PM
1/15/21 Boom.com Amazon Carlota 4:36 AM
1/19/21 Gel.com Amazon Quad 8:00 PM
1/11/21 Gel.com Amazon Aspen 8:42 AM
1/11/21 Gel.com Amazon Quad 12:48 PM
1/30/21 Gel.com Amazon Aspen 2:48 AM
1/20/21 Boom.com Amazon Quad 7:00 AM
1/1/21 Gel.com Amazon Carlota 4:12 AM
1/28/21 Boom.com Amazon Quad 8:00 PM
Time Formula in cell H7:
Goals: Create formula in cell C7 to lookup price of shipping based on weight and shipper name.

Standard Ship Prices:


Standard Pack Weight: 25 Formula in cell C7:
Shipper: UPS UPS Weight (lbs.) Price ($) Shippers:
Price: 0 11.95
5 16.95 Formula in cell J7:
15 29.95

Fed X Weight (lbs.) Price ($)


0 9.95
2 13.95
10 29.95
25 45.95

DHL Weight (lbs.) Price ($)


0 16.95
7 20.95
20 29.95
Formula in cell C7:

Formula in cell J7:

You might also like