0% found this document useful (0 votes)
29 views43 pages

Xlookup Function (16-7-23)

1) The document describes various lookup functions and methods in Excel, including XLOOKUP, VLOOKUP, INDEX, and MATCH. 2) It provides examples of using these functions to perform exact match lookups, next smaller/bigger lookups, column lookups, and record lookups. 3) The examples demonstrate looking up product prices, employee records, and aggregating column totals; comparing old school methods using VLOOKUP/INDEX-MATCH to newer XLOOKUP functions.

Uploaded by

nawplaypo
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)
29 views43 pages

Xlookup Function (16-7-23)

1) The document describes various lookup functions and methods in Excel, including XLOOKUP, VLOOKUP, INDEX, and MATCH. 2) It provides examples of using these functions to perform exact match lookups, next smaller/bigger lookups, column lookups, and record lookups. 3) The examples demonstrate looking up product prices, employee records, and aggregating column totals; comparing old school methods using VLOOKUP/INDEX-MATCH to newer XLOOKUP functions.

Uploaded by

nawplaypo
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/ 43

Link to Sheet: Topics:

1 XLOOKUP XLOOKUP function


2 EM(3) 1) Exact Match Lookup
3 Record 2) Lookup a Record
4 Column 3) Lookup a Column
5 NextSmaller(3) 4) Exact Match or Next Smaller Lookup
6 VorH 5) Vertical or Horizontal Lookup?
7 NextBigger 6) Exact Match or Next Bigger Lookup
8 Wild 7) Wild Card Lookup
9 First 8) Lookup First Item
10 Last 9) Lookup Last Item
1 2 3 4
XLOOKUP(lookup_value,lookup_array,return_array,[if_not_found],[match_mode],[searc
1 lookup_value = item used to find match in lookup_array
2 lookup_array = yields relative position to be used to retrieve item in return_array
3 return_array = contains items that you want to lookup or retrieve
* lookup_array and return_array must be the same size.
4 [if_not_found] = what to put in cell if lookup_value is not found in lookup_array

5 [match_mode] =

0 - Exact Match = Default. "Quad" matches "Quad". "Quad " does NOT match "Quad". If no m
nothing in 4th argument, #N/A.

-1 - Exact Match or Next Smaller = Use for items like tax rates and commission rates. Values
be sorted.

1 - Exact Match or Next Bigger = Use for items like square footage. Values do not have to be

2 - Wildcards => * = zero or more characters, ? = single character. "Quad*" finds anything
with "Quad". "*?" finds any text.

6 [search_mode] =
1 - Search First to Last = Default. When there are duplicates, it gets FIRST ONE!

-1 - Search Last To First = When there are Duplicates, it gets LAST ONE!

2 - Binary search for Smallest To Biggest Sort = Column must be sorted. Like old VLOOKUP an
Approximate Match Lookup.

2 - Binary search for Biggest To Smallest Sort = Column must be sorted. Like old MATCH -1 A
Match Lookup.
5 6
[match_mode],[search_mode])

tem in return_array

same size.
nd in lookup_array

T match "Quad". If no match and

mmission rates. Values do not have to

lues do not have to be sorted.

Quad*" finds anything that begins


RST ONE!

d. Like old VLOOKUP and MATCH

d. Like old MATCH -1 Approximate


What is Lookup?

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
What is Lookup?

Goal: Lookup product price using "Exact match lookup"


5) Get price of 43.95 an
Product Price bring back to the cell
1) Lookup the item "Quad"
Quad 43.95

Lookup Table: 2) Is exact match for "Quad" in product range?

ProductID Product Cost Price


A25C-4884 Aspen 14.55 26.95 4) Look in the
C20G-4398 Carlota 11.18 27.95 price range to
Q22G-9634 Quad 3 19.34 43.95 find the 3rd
S35G-4382 Sunshine 11.25 22.95 price
Y30C-4942 Yanaki 12.88 29.95

3) If yes, what is relative position (index) of "Quad"? Index = 3


) Get price of 43.95 and
bring back to the cell

oduct range?

) Look in the
rice range to
nd the 3rd
rice

1) Lookup the item "Quad"


2) Is exact match for "Quad" in product range?
3) If yes, what is relative position (index) of "Quad"? Index = 3
4) Look in the price range to find the 3rd price
5) Get price of 43.95 and bring back to the cell
Goal: Lookup product price using "Exact match" lookup
Old School 1:
Product Price Formula in C5: Product
Quad Quad

Lookup Table: Formula in L5:

ProductID Product Cost Price Quad


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
Old School 1:
First
43.95

Formula in L5: =VLOOKUP(K5,$C$10:$E$14,3,0)


Goal: Lookup product price using "Exact match" lookup
Old School 1:
Product Price Formula in C5: Product
Quad 43.95 =_xlfn.xlookup(B5,tProductAN[Product],tProductAN[Price]) Quad

Lookup Table: Formula in L5:

ProductID Product Cost Price Quad


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
Old School 1:
First
43.95

Formula in L5: =VLOOKUP(K5,$C$10:$E$14,3,0)


Goal: Lookup employee record based on EmployeeID in cell B5.

EmployeeID First Last StartDate CellPhone Department


4369-3979

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
Kip Hensel 10/6/20 206-821-4452 Maintenance

Formula in J5: =VLOOKUP($B$5,$B$10:$G$13,COLUMNS($J5:J5)+1,0)

Old School 2:
First Last StartDate CellPhone Department
Kip Hensel 10/6/20 206-821-4452 Maintenance

Formula in J11: =INDEX($C$10:$G$13,MATCH($B$5,$B$10:$B$13,0),MATCH(J10,$C$9:$G$9,0))


Goal: Lookup employee record based on EmployeeID in cell B5.

EmployeeID First Last StartDate CellPhone Department


4369-3979 ### #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
Kip Hensel 10/6/20 206-821-4 Maintenance

Formula in J5: =VLOOKUP($B$5,$B$10:$G$13,COLUMNS($J5:J5)+1,0)

Old School 2:
First Last StartDate CellPhone Department
Kip Hensel 10/6/20 206-821-4 Maintenance

Formula in J11: =INDEX($C$10:$G$13,MATCH($B$5,$B$10:$B$13,0),MATCH(J10,$C$9:$G$9,0))


Goal: Lookup column and then aggregate as sum.
Add total units by Day selected in cell C5.
Old School 1:
Select Day: Day 1 Formula in C6: First
Total Units 10,006

Units by Day: Formula in K6:

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:

Formula in K6: =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.
Old School 1:
Select Day: Day 1 Formula in C6: First
Total Units 10,006 =SUM(_xlfn.xlookup(C5,C10:F10,C11:F22)) 10,006

Units by Day: Formula in K6:

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:

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


What is Lookup?

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%
What is Lookup?

Goal: Lookup earnings tax rate using "Exact match or next smaller lookup"

1) Lookup the Weekly Earnings Tax Rate 5) Get tax rate of 10.0%
number 1200 $1,200 10.0% and bring it back to cell

2) Exact match of 1200? If no, next smaller


Lookup Table:
Weekly Earnings
Range of Earnings Tax Rate
4) Look in tax
Lower Limit rate range to find
$0 $0 - $299.99 0.0% the 4th tax rate
$300 $300 - $599.99 2.5%
$600 $600 - $999.99 7.0%
4 $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%

3) What is relative position (index) for match? Index = 4


f 10.0%
to cell
Goal: Lookup earnings tax rate using "Exact match or next smaller lookup"

Earnings TaxRate Formula in C5:


$1,200

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

Err:509

Earnings TaxRate Formula in C21:


-$100 Negative Numbers Not Allowed =_xlfn.xlookup(B21,B10:B15,D10:D15,"Negative Numbers N

Earnings TaxRate Formula in C24:


-$100 0.0% =_xlfn.xlookup(B24,B10:B15,D10:D15,0,-1)

Earnings TaxRate Formula in C31:


-$100 Negative Numbers Not Allowed =_xlfn.xlookup(B31,B10:B15,D10:D15,"Negative Numbers N

Earnings TaxRate Formula in C34:


-$100 0.0% =_xlfn.xlookup(B34,B10:B15,D10:D15,0,-1)
Old School 1:
Earnings TaxRate
$1,200 10.0%
10.0%
Formula in N5:
atting Formulas: =VLOOKUP(M5,B10:D15,3)
OR
FALSE FALSE FALSE Formula in N6:
FALSE FALSE FALSE =LOOKUP(M5,B10:D15)
FALSE FALSE FALSE
TRUE TRUE TRUE
FALSE FALSE FALSE
FALSE FALSE FALSE

Err:509

,D10:D15,"Negative Numbers Not Allowed",-1)

,D10:D15,0,-1)

,D10:D15,"Negative Numbers Not Allowed",-1)

,D10:D15,0,-1)
Goal: Lookup earnings tax rate using "Exact match or next smaller lookup"

Earnings TaxRate Formula in C5:


$1,200 10.0% =_xlfn.xlookup(B5,B10:B15,D10:D15,,-1)

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

Err:509

Earnings TaxRate Formula in C21:


-$100 Negative Numbers Not Allowed =_xlfn.xlookup(B21,B10:B15,D10:D15,"Negative Numbers N

Earnings TaxRate Formula in C24:


-$100 0.0% =_xlfn.xlookup(B24,B10:B15,D10:D15,0,-1)
Old School 1:
Earnings TaxRate
D10:D15,,-1) $1,200 10.0%
10.0%
Formula in N5:
atting Formulas: =VLOOKUP(M5,B10:D15,3)
OR
FALSE FALSE FALSE Formula in N6:
FALSE FALSE FALSE =LOOKUP(M5,B10:D15)
FALSE FALSE FALSE
TRUE TRUE TRUE
FALSE FALSE FALSE
FALSE FALSE FALSE

Err:509

,D10:D15,"Negative Numbers Not Allowed",-1)

,D10:D15,0,-1)
Goal: XLOOKUP can use vertical or horizontal lookup tables.
Grade Tables Use: "Exact Match or Next Smaller" or "Approximate Match" Lookup

Student: Gigi Student: Gigi


% Grade: 43.0% % Grade: 43.0%
Letter Grade: Letter Grade:

Formula in C7: Formula in F7:

Vertical Lookup Table: Horizontal Lookup Table:

% Grade Letter Grade Letter Grade A B C D F


90.0% A % Grade 90.0% 80.0% 70.0% 60.0% 0.0%
80.0% B
70.0% C
60.0% D
50.0% F

Old School 1: Old School 2:


Vertical Lookup Table: Horizontal Lookup Table:

% Grade Letter Grade Letter Grade 0.0% 60.0% 70.0% 80.0% 90.0%
50.0% F % Grade F D C B A
60.0% D
70.0% C
80.0% B
90.0% A

Student: Gigi Student: Gigi


% Grade: 43.0% % Grade: 43.0%
Letter Grade: F Letter Grade: F
Letter Grade: F
Formula in F36:
Formula in C36: =HLOOKUP(F35,F27:J28,2)
=IFNA(LOOKUP(C35,B28:C32),"F") Formula in F37:
=LOOKUP(F35,F27:J27,F28:J28)
Goal: XLOOKUP can use vertical or horizontal lookup tables.
Grade Tables Use: "Exact Match or Next Smaller" or "Approximate Match" Lookup

Student: Gigi Student: Gigi


% Grade: 43.0% % Grade: 43.0%
Letter Grade: F Letter Grade: F

Formula in C7: Formula in F7:


=_xlfn.xlookup(C6,B15:B19,C15:C19,"F",-1) =_xlfn.xlookup(F6,F15:J15,F14:J14,,-1)

Vertical Lookup Table: Horizontal Lookup Table:

% Grade Letter Grade Letter Grade A B C D


90.0% A % Grade 90.0% 80.0% 70.0% 60.0%
80.0% B
70.0% C
60.0% D
50.0% F

Old School 1: Old School 2:


Vertical Lookup Table: Horizontal Lookup Table:

% Grade Letter Grade Letter Grade 0.0% 60.0% 70.0% 80.0%


50.0% F % Grade F D C B
60.0% D
70.0% C
80.0% B
90.0% A

Student: Gigi Student: Gigi


% Grade: 43.0% % Grade: 43.0%
Letter Grade: F Letter Grade: F
Letter Grade: F
Formula in F36:
Formula in C36: =HLOOKUP(F35,F27:J28,2)
=IFNA(LOOKUP(C35,B28:C32),"F") Formula in F37:
=LOOKUP(F35,F27:J27,F28:J28)
5:J15,F14:J14,,-1)

F
0.0%

90.0%
A
Goal: Retrieve drain pipe size based on land square footage.

Land Square Footage 500 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))
Goal: Retrieve drain pipe size based on land square footage.

Land Square Footage 500 Formula in C5:


Pipe Size Required

Max Land Square Footage Drain Pipe


for Pipe Size 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))
Goal: Lookup Coca Cola and get a match for Coca Cola Inc.
Example of: Wildcard lookup (synonyms: partial text lookup, fuzzy lookup)

Company (partial
text) City Formula in C6:
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 N6:
=VLOOKUP("*"&M6&"*",B11:C14,2,0)

Text MECS Video #6 technique to extract all records that contain "Cola":

Company (partial text) Company (full text) City


Cola #NAME? #NAME?
#NAME? #NAME?
#NAME? #NAME?

Formula in M16:
{=_xlfn._xlws.filter(B11:C14,ISNUMBER(SEARCH(K14,B11:B14)))}
* This is using FILTER as a lookup function to return multiple items from a single lookup value.
Goal: Lookup Coca Cola and get a match for Coca Cola Inc.
Example of: Wildcard lookup (synonyms: partial text lookup, fuzzy lookup)

Company (partial
text) City Formula in C6:
Coca Atlanta =_xlfn.xlookup("*"&B6&"*",B11:B14,C11:C14,,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 N6:
=VLOOKUP("*"&M6&"*",B11:C14,2,0)

Text MECS Video #6 technique to extract all records that contain "Cola":

Company
(partial Company
text) (full text) City
Cola #NAME? #NAME?
#NAME? #NAME?
#NAME? #NAME?

Formula in M16:
{=_xlfn._xlws.filter(B11:C14,ISNUMBER(SEARCH(K14,B11:B14)))}
* This is using FILTER as a lookup function to return multiple items from a single lookup value.
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 ### ### ### ### ###
Chin x x x
Gigi x x
Sioux x x x
Chantel x x x x x
Billy x x

Formula in C8:

Enter and copy to rows below.

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

First Date
Employee Worked ### ### ### ### ###
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.

"x" marks when employee worked on project.

First Date
Employee Worked ### ### ### ### ###
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,"Didn't work")
Enter and copy to rows below.

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

First Date
Employee Worked ### ### ### ### ###
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, 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 duplicate m
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 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
10/6/2021 Sioux $811.12 Chin 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
Chin Enter and it spills down to rows below.

If you have a way of marking the last, like with a unique dat
Sales Rep Last Sale Formula in G21:
Sioux #NAME? {=_xlfn.xlookup(MAXIFS(B6:B15,C6:C15,F21:F22)&F21:F22,B
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,$B$6
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=F31
Chin 765.99 Copy Down
and there are no duplicate matches for SalesRep and Date!!!

cate sales for a given day:

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)}
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 duplicate m
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 ### {=MAXIFS(B6:B15,C6:C15,F16:F17)}
Chin ### Enter and it spills down to rows below.

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


Sales Rep Last Sale Formula in G21:
Sioux #NAME? {=_xlfn.xlookup(MAXIFS(B6:B15,C6:C15,F21:F22)&F21:F22,B
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,$B$
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=F3
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)}

You might also like