Lookup Functions
Advanced

VLOOKUP with MATCH choosing the column

Let the column header decide which column comes back.

Task:

The rate card has one column per size. In C10:C12 return each order's price, finding the product's row by name and the size's column by its header — so a reordered rate card does not break the formula.

Interactive Spreadsheet

Hints

+5 XPno-hints bonus

Solve it on your own to keep the bonus. Each hint gets one step closer to the formula.

The data in this exercise

This is the grid you start with. Cell references in the task — B6, C2 — point at the row numbers and column letters below.

12 rows × 4 columns3 cells you fill in
ABCD
1ProductSmallMediumLarge
2Latte2.93.43.9
3Mocha3.23.74.2
4Tea1.82.12.4
5Flat white33.54
6
7
8
9OrderSizePrice
10MochaLarge
11TeaSmall
12LatteMedium
What this exercise teachesMay contain the answer

A typed column number is the most fragile part of a VLOOKUP: insert a column into the table and every formula returns the wrong field without an error. Matching the header makes the formula look the column up by name, so it keeps working however the table is rearranged.