Excel HLOOKUP Practice Question: Use the row number in column B (2 is Sales, 3 is Profit) to look up the month…
The question
Use the row number in column B (2 is Sales, 3 is Profit) to look up the month in the table A1:E3. Put the results in C6 to C8.
The data
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Jan | Feb | Mar | Apr | May |
| 2 | 100 | 150 | 120 | 180 | 90 |
| 3 | 20 | 30 | 25 | 40 | 15 |
| 4 | |||||
| 5 | Month | Row | Value | ||
| 6 | Jan | 2 | ? | ||
| 7 | Jan | 3 | ? | ||
| 8 | Apr | 3 | ? |
The yellow cells are where your answer goes.
Show answer
Expected results:
- C6 = 100
- C7 = 20
- C8 = 40
How it works
Explanation: The row index of HLOOKUP can come from a cell, so one formula can return different rows of the table.
Syntax: =HLOOKUP(A6,$A$1:$E$3,B6,FALSE)
Jan with row 2 gives the sales 100. Jan with row 3 gives the profit 20. Apr with row 3 gives 40.
Try it yourself in the live sheet
Type your formula in the highlighted cell and get instant feedback. Free, no Excel install needed.
Try this question in the live sheet →HLOOKUP syntax
Like VLOOKUP but searches across the first row and pulls a value down a column. Pulling a specific month's figure from a report laid out horizontally instead of in columns. Full HLOOKUP guide.
More HLOOKUP practice questions
- Look up the sales of each month in the table A1:E2. Put the results in B5 to B7.
- Look up the profit (the third row of the table A1:E3) of each month. Put the results in…
- The table A1:D2 gives the grade from the marks (0 is D, 50 is C, 75 is B, 90 is A). Find…
- Find the amount (quantity in B times the price from the table A1:C2). Put it in C5 to C7.
- Find the tax rate for each income with an approximate match on the table A1:D2 (the rate…
- Look up the sales of each month in A1:E2. If the month is not in the table write No…
- Add the sales of the From month and the To month, using the table A1:E2. Put the totals…
- Quarterly targets are in A1:E3, with quarters across the top. Find the Q3 target for the…
All practice questions · Excel exercises · Interview prep · Cheat sheet