Cellgrids Cellgrids
Home › Practice questions › HLOOKUP › Question 8

Excel HLOOKUP Practice Question: Use the row number in column B (2 is Sales, 3 is Profit) to look up the month…

By Rinkesh Shah, founder of Cellgrids.

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

ABCDE
1JanFebMarAprMay
210015012018090
32030254015
4
5MonthRowValue
6Jan2?
7Jan3?
8Apr3?

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

=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])

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

All practice questions · Excel exercises · Interview prep · Cheat sheet