The request

From Jacob Long, Account Executive
Your goal
In D7:D24, use HLOOKUP to return the 2024 average order for each order's quarter: look up the quarter in column B in the top row of the summary B1:E4 and return its 4th row (avg_order), with an exact match (FALSE). Then in E7:E24, use IF to show "above" when the subtotal in column C is at least that average, otherwise "below".
- Fill
D7:E24with the right valuesnot done yet - With formulas, not typed numbersnot done yet
- Use
HLOOKUPIFnot done yet
Your sheet
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | 2024 | Q1 | Q2 | Q3 | Q4 | |
| 2 | orders | 658 | 730 | 793 | 1492 | |
| 3 | revenue | 348,329.76 | 441,258.27 | 444,959.49 | 759,057.79 | |
| 4 | avg_order | 529.38 | 604.46 | 561.11 | 508.75 | |
| 5 | ||||||
| 6 | order_id | quarter | subtotal | avg_2024 | vs_2024 | |
| 7 | 8250 | Q1 | 56.97 | |||
| 8 | 8500 | Q1 | 19.99 | |||
| 9 | 8750 | Q1 | 192.59 | |||
| 10 | 9000 | Q1 | 59.97 | |||
| 11 | 9250 | Q2 | 2594.95 | |||
| 12 | 9500 | Q2 | 1099.00 | |||
| 13 | 9750 | Q2 | 50.97 | |||
| 14 | 10000 | Q2 | 495.97 | |||
| 15 | 10250 | Q3 | 804.99 | |||
| 16 | 10500 | Q3 | 232.98 | |||
| 17 | 10750 | Q3 | 29.99 | |||
| 18 | 11000 | Q3 | 380.99 | |||
| 19 | 11250 | Q4 | 235.97 | |||
| 20 | 11500 | Q4 | 1253.88 | |||
| 21 | 11750 | Q4 | 507.00 | |||
| 22 | 12000 | Q4 | 17.99 | |||
| 23 | 12500 | Q4 | 19.99 | |||
| 24 | 12750 | Q4 | 169.92 | |||
| 25 | ||||||
| 26 |
Loading the editor…
Reference solution
Mote checks your result
Press Check. Each right cell becomes a firefly in your lantern.
What Jacob gets, and why
The lesson
Most tables run down the page: one record per row, one field per column. Some run sideways.
Budgets, targets and finance summaries often put the periods across the top (Q1, Q2, Q3, Q4 or
January to December) and the measures down the side. The summary in A1:E4 is one of those:
quarters in row 1, then 2024’s completed orders, revenue and average order underneath.
HLOOKUP reads across
HLOOKUP is VLOOKUP turned on its side. It searches the top row of a table and returns a
value from a row below it:
=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
| Argument | In D7 | Means |
|---|---|---|
lookup_value |
B7 |
the quarter to find (“Q1”) |
table_array |
$B$1:$E$4 |
the summary, with the quarters in its first row |
row_index_num |
4 |
which row of the table to return, counting the top row as 1 |
range_lookup |
FALSE |
exact match only |
For order 8250 in row 7, HLOOKUP finds “Q1” in B1 and goes down to the 4th row of the table:
B4, 529.38. Use 3 instead and you get Q1’s total revenue, 348,329.76. Use 5 and you get
#REF!, because the table has four rows. A quarter that isn’t in the top row, such as “Q5”,
gives #N/A. As with VLOOKUP, write FALSE every time: the default is an approximate match.
Counting the row number
The row number counts inside the table, not on the sheet. The table starts at row 1 of the
sheet here, so the numbers happen to agree; move the summary down to rows 10 to 13 and avg_order
is still row 4 of the table. Leave column A out of the table: it holds labels, not quarters, and
the lookup only needs B1:E4.
Comparing with IF
With last year’s average next to each order, the second column is a plain IF from chapter 1:
=IF(C7>=D7,"above","below")
Filled down to row 24, 4 of the 18 orders beat their quarter’s 2024 average: 9250 and 9500 in Q2, 10250 in Q3 and 11500 in Q4. Order 11750 is the near miss: 507.00 against Q4’s 508.75.
Sideways or flipped?
If you need to work with a horizontal table a lot, you can flip it: copy it, then Paste Special
→ Transpose (Ctrl+Alt+V in Excel, then tick Transpose; in Google Sheets, Paste special →
Transposed). Rows become columns and VLOOKUP works on the copy. The copy doesn’t update when
the original changes, though, so for a live summary, look it up where it is. XLOOKUP also reads
rows: =XLOOKUP(B7,$B$1:$E$1,$B$4:$E$4) returns the same 529.38.
Common mistakes
- VLOOKUP on a horizontal table. It searches the first column, so it finds the wrong thing or nothing at all.
- The wrong row number. Row 3 is revenue, not the average.
- Unlocked table.
B1:E4filled down becomesB2:E5, and the quarters slide out of the top row. - “Q1” vs “q1 ”. Lookups ignore case but not spaces. A stray space in an export makes every lookup on that row miss.
Lantern lit!
Practised: hlookuplookupsexact matchif
- Solved
- No hints
- First run
