Practice by topic / Excel / Lookups

Lookups With Multiple Criteria Exercises

VLOOKUP searches one column, so for two criteria (region and quarter, product and size) you either build a helper key such as =A2&"-"&B2 and look that up, or use SUMIFS when the answer is a number. These exercises cover both, with XLOOKUP, INDEX/MATCH and IFERROR versions. These 10 exercises build up step by step, starting with build a helper key, vlookup on a helper key, xlookup on a helper key.

3 of 10 free · no sign-up needed · graded on the formula you write

1

Build a Helper Key

Free

A2 holds a region and B2 a quarter. Write a formula in C2 that joins them with a hyphen, e.g. 'North-Q1', to make a lookup key.

ABC
1RegionQuarterKey
2NorthQ1?
Show the solution

Use =A2&"-"&B2

Right — a helper key turns two criteria into one value that VLOOKUP can search for.

Expected result in C2: North-Q1

Try it in the live spreadsheet →
2

VLOOKUP on a Helper Key

Free

C2:C7 hold keys like 'North-Q1' and D2:D7 sales. F2 holds a region and G2 a quarter. Write a formula in H2 that looks up the sales for that region and quarter.

ABCDEFGH
1RegionQuarterKeySalesRegionQuarterSales
2NorthQ1North-Q112000SouthQ2?
3NorthQ2North-Q213500
4SouthQ1South-Q19800
5SouthQ2South-Q211200
6EastQ1East-Q17600
7EastQ2East-Q28900
Show the solution

Use =VLOOKUP(F2&"-"&G2,C2:D7,2,FALSE)

Good — build the same key from F2 and G2 inside the VLOOKUP, then search the key column.

Expected result in H2: 11200

Try it in the live spreadsheet →
3

XLOOKUP on a Helper Key

Free

C2:C7 hold keys like 'North-Q1' and D2:D7 sales. F2 holds a region and G2 a quarter. Write a formula in H2 that uses XLOOKUP to return the sales for that combination.

ABCDEFGH
1RegionQuarterKeySalesRegionQuarterSales
2NorthQ1North-Q112000NorthQ2?
3NorthQ2North-Q213500
4SouthQ1South-Q19800
5SouthQ2South-Q211200
6EastQ1East-Q17600
7EastQ2East-Q28900
Show the solution

Use =XLOOKUP(F2&"-"&G2,C2:C7,D2:D7)

Right — XLOOKUP takes the lookup column and the return column separately.

Expected result in H2: 13500

Try it in the live spreadsheet →
4

INDEX and MATCH on a Helper Key

C2:C7 hold keys like 'North-Q1' and D2:D7 sales. F2 holds a region and G2 a quarter. Write a formula in H2 that uses INDEX and MATCH to return the sales for that combination.

ABCDEFGH
1RegionQuarterKeySalesRegionQuarterSales
2NorthQ1North-Q112000EastQ1?
3NorthQ2North-Q213500
4SouthQ1South-Q19800
5SouthQ2South-Q211200
6EastQ1East-Q17600
7EastQ2East-Q28900

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
5

SUMIFS as a Two-Criteria Lookup

A2:A7 hold regions, B2:B7 quarters and C2:C7 sales, with no helper column. E2 holds a region and F2 a quarter. Write a formula in G2 that returns the sales for that combination.

ABCDEFG
1RegionQuarterSalesRegionQuarterSales
2NorthQ112000EastQ2?
3NorthQ213500
4SouthQ19800
5SouthQ211200
6EastQ17600
7EastQ28900

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
6

Price by Product and Size

C2:C7 hold keys like 'Tee-S' and D2:D7 prices. F2 holds a product and G2 a size. Write a formula in H2 that returns the price for that product and size.

ABCDEFGH
1ProductSizeKeyPriceProductSizePrice
2TeeSTee-S15HoodieL?
3TeeMTee-M15
4TeeLTee-L17
5HoodieSHoodie-S35
6HoodieMHoodie-M35
7HoodieLHoodie-L38

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
7

Handle a Combination That Doesn't Exist

C2:C7 hold keys like 'North-Q1' and D2:D7 sales. F2 holds a region and G2 a quarter. Write a formula in H2 that returns the sales, or 'No data' if the combination isn't in the table.

ABCDEFGH
1RegionQuarterKeySalesRegionQuarterSales
2NorthQ1North-Q112000WestQ1?
3NorthQ2North-Q213500
4SouthQ1South-Q19800
5SouthQ2South-Q211200
6EastQ1East-Q17600
7EastQ2East-Q28900

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
8

Hours by Employee and Month

A2:A7 hold employees, B2:B7 months and C2:C7 hours worked. E2 holds an employee and F2 a month. Write a formula in G2 that returns the hours for that employee and month.

ABCDEFG
1EmployeeMonthHoursEmployeeMonthHours
2AliJan160MeiFeb?
3AliFeb152
4MeiJan148
5MeiFeb170
6RajJan155
7RajFeb140

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
9

Check Whether a Combination Exists

A2:A7 hold employees and B2:B7 months. E2 holds an employee and F2 a month. Write a formula in G2 that returns 'Found' if that employee and month appear together in the table, otherwise 'Not found'.

ABCDEFG
1EmployeeMonthHoursEmployeeMonthStatus
2AliJan160RajMar?
3AliFeb152
4MeiJan148
5MeiFeb170
6RajJan155
7RajFeb140

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
10

Three Criteria at Once

A2:A7 hold regions, B2:B7 quarters, C2:C7 sales channels and D2:D7 sales. F2, G2 and H2 hold a region, quarter and channel. Write a formula in I2 that returns the sales for that combination.

ABCDEFGHI
1RegionQuarterChannelSalesRegionQuarterChannelSales
2NorthQ1Online5000NorthQ2Online?
3NorthQ1Store7000
4NorthQ2Online6500
5SouthQ1Online4300
6SouthQ1Store5500
7NorthQ2Store7000

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →