Lookup & reference function

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])
ArgumentWhat it means
lookup_valueRequiredThe value to find in the first row of table_array, such as a month or quarter heading.
table_arrayRequiredThe table to search. HLOOKUP only searches its top row.
row_index_numRequiredWhich row of the table to return, counted from the top. 1 returns the heading row itself.
range_lookupOptionalFALSE 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

B6fx=HLOOKUP("Q3", B1:E4, 3, FALSE)
ABCDE
1RegionQ1Q2Q3Q4
2North12500142001390016100
3South9800104001125012030
4East7600815089009420
5
611250

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

B4fx=HLOOKUP(73, B1:F2, 2, TRUE)
ABCDEF
1Score050658090
2GradeFDCBA
3
4C

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

B6fx=HLOOKUP("Q4", A1:E4, MATCH("East", A1:A4, 0), FALSE)
ABCDE
1RegionQ1Q2Q3Q4
2North12500142001390016100
3South9800104001125012030
4East7600815089009420
5
69420

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.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 16 KB

Common errors and how to fix them

ErrorWhy it happensFix
#N/AThe 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 FALSE for 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.

LanguageFunction name
CzechVVYHLEDAT
DanishVOPSLAG
DutchHORIZ.ZOEKEN
FinnishVHAKU
FrenchRECHERCHEH
GermanWVERWEIS
HungarianVKERES
ItalianCERCA.ORIZZ
Norwegian (Bokmål)FINN.KOLONNE
PolishWYSZUKAJ.POZIOMO
Portuguese (Brazil)PROCH
Portuguese (Portugal)PROCH
RussianГПР
SpanishBUSCARH
SwedishLETAKOLUMN
TurkishYATAYARA