HLOOKUP
VLOOKUP's sideways sibling: looks for a match across the top row of a table, then reads down.
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
| Argument | Description |
|---|---|
| lookup_value | Required. What to search for, matched against the table's top row. |
| table_array | Required. The table, with lookup values in its first row. |
| row_index_num | Required. Which row to pull the result from: row 1 is the header row itself, row 2 is one row down, and so on. |
| range_lookup | Optional. 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:
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
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Metric | Q1 | Q2 | Q3 |
| 2 | Revenue | 400 | 450 | 480 |
| A | B | C | |
|---|---|---|---|
| 1 | Metric | Q1 | Q2 |
| 2 | Revenue | 400 | 450 |
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 →