
Search for a value in the top row of a table and return a value from a specified row in the same column. HLOOKUP is useful when headers run across the top instead of down the left side.
The Excel HLOOKUP function searches for a value in the top row of a table or array and returns a value from a specified row in the same column. It is the horizontal version of VLOOKUP, so it is most useful when your lookup keys are arranged across the top instead of down the first column.
In practice, HLOOKUP is often used in wide tables such as year-by-year models, monthly schedules, or horizontal product layouts. If the header row contains the value you want to find, HLOOKUP can retrieve the corresponding value from a lower row.
Although newer functions such as XLOOKUP are more flexible, HLOOKUP still appears in many existing workbooks, so it is worth understanding how it behaves and where its limits are.
Finds a match in row 1 of the selected table and returns a value from a row below it in the same column.
Returns text, numbers, dates, or other values from the row you specify inside the table.
=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
lookup_value is the item to find in the top row, table_array is the full table, row_index_num is the row to return from within that table, and range_lookup controls whether the match is exact or approximate.
The row index is counted relative to the selected table, not the worksheet. If your table starts in A1:C3, then row 1 means A1:C1, row 2 means A2:C2, and row 3 means A3:C3.
FALSE for exact match or TRUE for approximate match.For approximate match, the top row should be sorted in ascending order. If it is not sorted, the returned result can be incorrect even though the formula does not show an error.
HLOOKUP is one of several lookup functions, but its direction is its defining feature.
| Function | Main Direction | Use When |
|---|---|---|
HLOOKUP |
Across the top row | Your lookup keys are stored horizontally in row 1 |
VLOOKUP |
Down the first column | Your lookup keys are stored vertically in column 1 |
XLOOKUP |
Flexible | You want a newer lookup function that works in any direction |
INDEX + MATCH |
Flexible with separate position logic | You need more control over the lookup and return logic |
Use HLOOKUP when the table is already horizontal. If the workbook is being built from scratch, many users now prefer XLOOKUP for greater flexibility.
HLOOKUP works best in wide tables where the important labels are across the top. Typical examples include years in a forecast, months in a budget, or SKU codes in a horizontal specification table.
Exact match is the safer default for most text or code lookups. Approximate match is mainly for sorted numeric brackets such as thresholds or tier tables.
One limitation to keep in mind is that HLOOKUP uses a fixed row index. If rows are inserted inside the table, a hard-coded row number may point to the wrong result. Using MATCH to calculate the row index can make the formula more stable.
FALSE for exact matches such as codes, labels, or specific years.TRUE only when the top row is sorted and you want bracket-style matching.MATCH for the row index if the table may gain or lose rows later.This formula finds the year 2024 in the top row and returns the value from row 2 of the same column. It is a simple example of using HLOOKUP in a year-by-year table.
=HLOOKUP(2024, A1:C2, 2, FALSE)
Search for 2024 in the top row and return the rate from row 2. Formula: =HLOOKUP(2024, A1:C2, 2, FALSE).
Here HLOOKUP searches the top row for "SKU_2" and returns the material from row 3. This shows how the function can retrieve different attributes from the same matched column depending on the row index you provide.
=HLOOKUP("SKU_2", A1:C3, 3, FALSE)
Find the target for "Mar" in a horizontal header row. Formula: =HLOOKUP("Mar", A1:C2, 2, FALSE).
This formula uses approximate match to find the largest quantity breakpoint that does not exceed 150. Because the top row is sorted as 0, 100, 500, the lookup lands on 100 and returns the corresponding rate from row 2.
=HLOOKUP(150, A1:C2, 2, TRUE)
Find the discount tier for a quantity of 150 in a sorted horizontal table. Formula: =HLOOKUP(150, A1:C2, 2, TRUE).
Using MATCH inside the row index makes the return row dynamic. Instead of hard-coding row 3, the formula finds where "Metric_2" appears in column A and uses that position inside HLOOKUP.
=HLOOKUP("Data_B", A1:C3, MATCH("Metric_2", A1:A3, 0), FALSE)
Retrieve the third row for SKU "X-01" in a horizontal lookup table. Formula: =HLOOKUP("X-01", A1:D3, 3, FALSE).
HLOOKUP searches the top row and returns a value from a lower row in the same column.=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup]).Tell your friends about this post