The Excel HLOOKUP function is VLOOKUP turned sideways: it searches the top row of a table and returns a value from a row below in the same column. Use it when your data runs horizontally — months across the top, metrics down the side — and watch for the same traps that bite VLOOKUP users.
FALSE for an exact match — the default is approximate, just like VLOOKUP.
Syntax
| Argument | Description | |
|---|---|---|
lookup_value | Required | The value to find in the top row of the table. |
table_array | Required | The table to search. The lookup row must be the first row of this range. |
row_index_num | Required | The row number within the table to return from (1 = the lookup row itself, 2 = the next row down, and so on). |
range_lookup | Optional | FALSE = exact match. TRUE = approximate match (the default!) — requires the top row sorted ascending left to right. |
Same trap as VLOOKUP: omit the last argument and HLOOKUP defaults to approximate match — silent wrong answers on unsorted data. Type FALSE every time.
Exact-match lookup across a horizontal table
The table below runs sideways: months across the top, metrics down the side. To get April’s sales, find "Apr" in the top row and return row 2 of the table:
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Month | Jan | Feb | Mar | Apr | May | Jun |
| 2 | Sales | $8,200 | $7,900 | $8,600 | $9,100 | $9,800 | $10,400 |
| 3 | Expenses | $6,100 | $6,300 | $6,200 | $6,500 | $6,900 | $7,100 |
| 4 | Profit | $2,100 | $1,600 | $2,400 | $2,600 | $2,900 | $3,300 |
Change row_index_num to 4 and the same formula returns April’s profit. As with VLOOKUP, wrap in IFERROR to handle missing months gracefully:
Try it: interactive HLOOKUP demo
Walk the horizontal table above: pick a month and a row, and watch HLOOKUP fetch the value.
Approximate match: thresholds across the top
With TRUE and a top row sorted ascending left to right, HLOOKUP finds the bracket a number falls into — handy for volume discounts laid out horizontally (quantities 0 / 10 / 50 / 100):
Should you still use HLOOKUP?
HLOOKUP has every VLOOKUP limitation, rotated: it can’t look up (only rows below the lookup row), row_index_num breaks when rows are inserted, and the approximate default is dangerous. In Excel 2021+/365, XLOOKUP handles horizontal lookups with the same syntax as vertical ones:
For older Excel versions, INDEX + MATCH works sideways too:
Design tip: horizontal layouts are usually harder to maintain than vertical ones. If you control the data, consider transposing it and using VLOOKUP/XLOOKUP — columns grow more gracefully than rows.
Errors & common pitfalls
#N/A — value not found. The value isn’t in the top row, or differs invisibly: stray spaces, text-formatted numbers, or pasted characters. Clean with TRIM or convert text numbers, or wrap in IFERROR.
#REF! — row_index_num too large. Asking for row 5 of a 4-row table. Count only the rows inside table_array.
#VALUE! — row_index_num less than 1. Usually a broken cell reference feeding the row number.
Pitfall: inserted rows shift your answers. row_index_num is a hard-coded count from the top row. Insert a row inside the table and every HLOOKUP silently returns the wrong metric.
Pitfall: only the first match counts. Duplicate headers in the top row? HLOOKUP only ever finds the leftmost one.
Practice workbook
Frequently asked questions
What's the difference between HLOOKUP and VLOOKUP?
How do I make HLOOKUP an exact match?
What replaces HLOOKUP in modern Excel?
Can HLOOKUP return a row above the lookup row?
Does HLOOKUP support wildcards?
Master functions like this in one day
This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class