Excel function reference

HLOOKUP

Quick answer

VLOOKUP's sideways sibling: looks for a match across the top row of a table, then reads down.

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

HLOOKUP exists specifically for tables laid out with categories running left to right across a row instead of down a column; a quarterly summary with Q1, Q2, Q3, Q4 as column headers is the classic shape. Everything else about it mirrors VLOOKUP closely: a lookup value that isn't found still returns #N/A rather than guessing at something plausible.

The one number worth double-checking every time is row_index_num: row 1 is the header row itself, not the first row of actual data, so the first real data row is always row 2.

Syntax

HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
ArgumentDescription
lookup_valueRequired. What to search for, matched against the table's top row.
table_arrayRequired. The table, with lookup values in its first row.
row_index_numRequired. Which row to pull the result from: row 1 is the header row itself, row 2 is one row down, and so on.
range_lookupOptional. LearnExcel's HLOOKUP always matches exactly, the same as its VLOOKUP, regardless of this argument.

A real example: pulling one quarter out of a sideways summary table

A revenue table with quarters across the top instead of down the side:

=HLOOKUP("Q2",A1:D2,2)

row_index_num of 2 means "one row below the header row holding Q1/Q2/Q3," which is exactly where the actual revenue figures live; this would be VLOOKUP's job instead if the table were rotated the usual way, with quarters running down a column.

Worked examples

Reading one quarter's value
ABCD
1MetricQ1Q2Q3
2Revenue400450480
=HLOOKUP("Q2",A1:D2,2) → 450
A lookup value that isn't in the header row
ABC
1MetricQ1Q2
2Revenue400450
=HLOOKUP("Q5",A1:C2,2) → #N/A

Common mistakes

  • Reaching for HLOOKUP on a normally-laid-out table (categories down a column). That's VLOOKUP's job: HLOOKUP is specifically for a sideways table.
  • Miscounting row_index_num. Row 1 is the header row itself, not "the first row of data"; the first real data row is row 2.
  • Expecting an approximate match. This engine's HLOOKUP, like its VLOOKUP, always requires an exact match.

Related functions

Try it yourself

A free, graded practice exercise using this exact function: instant feedback, no signup required.

Practice HLOOKUP →