FormulaCamp
Completed
← All functions
Lookup & reference

HLOOKUP

Same, but searches the first row.

Syntax

HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])

Example: =HLOOKUP("March",A1:M5,3,0)

Available in: All versions

HLOOKUP searches the top row of a table for a value and returns a value from a row below it, in the same column. It is the horizontal version of VLOOKUP, built for data laid out with headers across the top.

When to use it

Arguments explained

Worked examples

Revenue for a given month

ABCD
1MonthJanFebMar
2Revenue120001350015200
3Costs800082009100

Formula: F1: =HLOOKUP("Feb",B1:D3,2,FALSE)

Result: 13500

Finds Feb in the top row of B1:D3 and returns the 2nd row of the table (Revenue).

Costs for March

ABCD
1MonthJanFebMar
2Revenue120001350015200
3Costs800082009100

Formula: F1: =HLOOKUP("Mar",B1:D3,3,FALSE)

Result: 9100

Row index 3 is the Costs row of the table.

Horizontal tier table

ABCD
1Orders from050200
2Discount00.050.1

Formula: A4: =HLOOKUP(120,B1:D2,2,TRUE)

Result: 0.05

120 lies between 50 and 200, so approximate match returns the 50-tier discount of 5%.

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in G2: =HLOOKUP("Q3",B1:E3,2,FALSE)

Example spreadsheet for HLOOKUP
ABCDEFG
1MetricQ1Q2Q3Q4Result
2Revenue120135150170150
3Costs808590100
Result in G2: 150

Common errors and how to fix them

Related functions

Frequently asked questions

What is the difference between VLOOKUP and HLOOKUP?
VLOOKUP searches the first column and returns from a column; HLOOKUP searches the first row and returns from a row.
Can HLOOKUP return rows above the header?
No, it only returns rows below the lookup row. Use INDEX/MATCH or XLOOKUP for that.
Is HLOOKUP still worth learning?
It is common in older workbooks, so yes, but for new files XLOOKUP is simpler.
Does HLOOKUP support wildcards?
Yes, with exact match (FALSE): "Q*" matches the first header starting with Q.

More in Lookup & reference