HLOOKUP looks across the top row of a table for a value and returns the item from another row in the same column. It is VLOOKUP turned on its side, built for tables where the headers run across the page, such as months or quarters in row 1 and one line per measure underneath.
The four arguments
- lookup_value is what you are searching for. Point at a cell rather than typing the value.
- table_array is the block that holds the header row and the rows below it. HLOOKUP always searches the top row of this block, so the range must start on the header row.
- row_index_num is the position of the row to return, counted from the top of table_array.
1 is the header row itself, 2 is the row below it, and so on. A number larger than the table is tall returns #REF!. - range_lookup chooses the match type.
FALSE (or 0) is an exact match. TRUE, or leaving the argument out, is an approximate match.
Exact or approximate
As with VLOOKUP, the default is approximate. It assumes the top row is sorted ascending and returns the column whose header is the largest value not above your lookup value. That suits numeric bands laid out across a row, such as discount tiers by order size. For text headers such as month names or product codes, type FALSE. Month names aren't sorted alphabetically, so an approximate match on them returns wrong answers without any error.
An exact match returns the first match from the left, ignores case, and accepts the wildcards * and ? in text.
When to use something else
HLOOKUP shares every weakness of VLOOKUP, turned sideways. The row number is a hard-coded count, so inserting a row inside the table can silently change the result. It can't return a row above the header row. And the approximate default catches people out.
INDEX with MATCH works in every version of Excel and has none of those limits. XLOOKUP handles horizontal data too: point lookup_array at the header row and return_array at the row you want, and the result survives inserted rows. It needs Excel 2021 or Microsoft 365.
If the data is yours to lay out, put headers across the top only when the table is short and meant to be read like a report. Long lists are easier to filter, sort and total when the headers run down the first column of a normal table, and then VLOOKUP, XLOOKUP and the rest of the lookup family work without surprises.
Handling a missing value
An exact HLOOKUP returns #N/A when the header isn't in the top row. Wrap it in IFNA to show a message instead: =IFNA(HLOOKUP(B10,A1:F4,3,FALSE),"No such month").