HLOOKUP in Excel: Look Up Values in Rows
HLOOKUP finds a value in the top row of a table and returns a value below it. Syntax, an example with months across, its limits, and modern alternatives.
By Ayoub Farid · · 1 min read
HLOOKUP is VLOOKUP turned on its side. It searches across the top row of a table and returns a value from a row below. You'll meet it in tables where months or years run across the columns.
Syntax
=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
Example
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Jan | Feb | Mar | |
| 2 | Sales | 4,200 | 3,900 | 4,800 |
| 3 | Costs | 2,600 | 2,500 | 2,900 |
Costs for the month in F1 ("Feb"):
=HLOOKUP(F1,$B$1:$D$3,3,FALSE) → 2,500
Row 3 of the table is Costs. As with VLOOKUP, always use FALSE for exact matches.
Limits
- Searches only the top row and only returns values below it.
- Hard-coded row numbers break if rows are inserted.
Better options
- XLOOKUP handles rows too:
=XLOOKUP(F1,$B$1:$D$1,$B$3:$D$3) - INDEX MATCH works in every version
- For row-and-column lookups, see the two-way lookup in INDEX MATCH
Should you learn it?
Learn VLOOKUP or XLOOKUP first. HLOOKUP takes two minutes once you understand those, and it occasionally appears in job tests.
Frequently asked questions
What is the difference between VLOOKUP and HLOOKUP?
VLOOKUP searches down the first column; HLOOKUP searches across the first row.
Can XLOOKUP replace HLOOKUP?
Yes. Point the lookup and return arrays at rows instead of columns.
Why does HLOOKUP return #N/A?
The value isn't in the top row exactly, often because of spaces or number/text mismatches.
Does Google Sheets have HLOOKUP?
Yes.