HLOOKUP function
Searches the top row of a table for a value and returns a value from a row further down in the same column.
Available in All versions of Excel, including Microsoft 365, Excel for the web and Excel for Mac
In every Excel versionWorks in Google Sheets
Syntax
HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])| Argument | What it means | |
|---|---|---|
lookup_value | Required | The value to find in the first row of table_array, such as a month or quarter heading. |
table_array | Required | The table to search. HLOOKUP only searches its top row. |
row_index_num | Required | Which row of the table to return, counted from the top. 1 returns the heading row itself. |
range_lookup | Optional | FALSE for an exact match. TRUE or omitted for an approximate match, which needs the top row sorted left to right in ascending order. |
Returns: One value from row row_index_num in the column where the match was found.
How HLOOKUP works
HLOOKUP is the sideways twin of VLOOKUP. The H stands for horizontal: instead of scanning down a column, it scans across the first row of a table. That suits sheets laid out with periods across the top - Q1, Q2, Q3, Q4 or Jan to Dec - and regions or cost lines down the side.
Once HLOOKUP finds the column whose heading matches lookup_value, it drops down to row row_index_num and returns that cell. As with VLOOKUP, the last argument matters: FALSE demands an exact match, while TRUE (the default) returns the last heading that is less than or equal to the lookup value and expects the headings to be sorted. Exact matching is what you want for labels; approximate matching is for numeric bands such as grade boundaries.
The row number is a fixed count, so inserting a row inside the table can shift your result. Combining HLOOKUP with MATCH for the row number, or switching to XLOOKUP, makes the formula sturdier.
Examples
1Sales for one quarter
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Region | Q1 | Q2 | Q3 | Q4 |
| 2 | North | 12500 | 14200 | 13900 | 16100 |
| 3 | South | 9800 | 10400 | 11250 | 12030 |
| 4 | East | 7600 | 8150 | 8900 | 9420 |
| 5 | |||||
| 6 | 11250 |
Result: 11250
HLOOKUP finds Q3 in the header row B1:E1 (third column), then returns row 3 of B1:E4, which is the South line: 11250.
2Letter grade from a score band
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Score | 0 | 50 | 65 | 80 | 90 |
| 2 | Grade | F | D | C | B | A |
| 3 | ||||||
| 4 | C |
Result: C
With an approximate match HLOOKUP takes the last boundary that is not above 73, which is 65, and returns the grade beneath it.
3Let MATCH pick the row
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Region | Q1 | Q2 | Q3 | Q4 |
| 2 | North | 12500 | 14200 | 13900 | 16100 |
| 3 | South | 9800 | 10400 | 11250 | 12030 |
| 4 | East | 7600 | 8150 | 8900 | 9420 |
| 5 | |||||
| 6 | 9420 |
Result: 9420
MATCH returns 4 because East is the 4th cell of A1:A4, so HLOOKUP returns row 4 under Q4. If someone inserts a new region row later, MATCH adjusts automatically.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#N/A | The heading was not found in the top row (spelling, extra spaces, or a number stored as text). | Check the heading text, use TRIM, or wrap the formula in IFNA. |
#REF! | row_index_num is larger than the number of rows in table_array. | Extend the table range or use a smaller row number. |
#VALUE! | row_index_num is less than 1. | Row numbers start at 1 (the heading row). |
Tips
- If your data could be turned around, consider TRANSPOSE - most people find vertical lists easier to maintain.
- Always type
FALSEfor text headings; an omitted fourth argument means approximate matching. - HLOOKUP ignores upper and lower case.
Questions
When should I use HLOOKUP instead of VLOOKUP?
Use HLOOKUP when the values you search for run across a row (like months in a header) rather than down a column.
Is there a modern replacement?
Yes. XLOOKUP works in both directions, so one function covers both VLOOKUP and HLOOKUP cases.
Google Sheets
HLOOKUP also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
HLOOKUP in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Czech | VVYHLEDAT |
| Danish | VOPSLAG |
| Dutch | HORIZ.ZOEKEN |
| Finnish | VHAKU |
| French | RECHERCHEH |
| German | WVERWEIS |
| Hungarian | VKERES |
| Italian | CERCA.ORIZZ |
| Norwegian (Bokmål) | FINN.KOLONNE |
| Polish | WYSZUKAJ.POZIOMO |
| Portuguese (Brazil) | PROCH |
| Portuguese (Portugal) | PROCH |
| Russian | ГПР |
| Spanish | BUSCARH |
| Swedish | LETAKOLUMN |
| Turkish | YATAYARA |