In Excel: use =HLOOKUP(lookup_value, table_array, row_index_num, FALSE) — it searches across the top row of a table for a value and returns a value from a row below it, with FALSE forcing an exact match.
Syntax
Arguments
| Argument | Description | |
|---|---|---|
lookup_value | required | The value to look for in the top row of the table. |
table_array | required | The range that holds the data, with the lookup values in the top row. |
row_index_num | required | The row number to return from, counted from the top of table_array (1 = top row). |
range_lookup | optional | FALSE for an exact match, TRUE or omitted for an approximate match on a row sorted left to right. |
Related functions
In the result cell type =HLOOKUP( and click the cell holding the value to find.
Select the whole table as table_array, with the lookup values along the top row.
Count rows from the top of that range down to the answer row and type that number as row_index_num.
Type FALSE as the fourth argument to force an exact match.
Press Enter and copy the formula across or down as needed.
What this does
HLOOKUP is the horizontal sibling of VLOOKUP: instead of searching down the first column it searches across the top row, then returns the cell from a row below that you pick by number. It suits tables laid out sideways, where labels run along a header row and the values you want sit underneath. Like VLOOKUP it only looks downward from the search row and needs FALSE for an exact match. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. Treat “excel function hlookup” as a small repeatable workflow rather than a one-off click you hope to remember next time. Use a small test block before the live file, so any surprise in the affected formula shows up while it is still harmless. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That turns a data step that keeps your analysis trustworthy into a method you can reuse, explain, and defend when the workbook leaves your screen.
A worked example
Months are headers in B1:M1 and revenue sits in row 2 (B2:M2), so the table spans B1:M2. To pull revenue for the month typed in A5: =HLOOKUP(A5, B1:M2, 2, FALSE). Row 2 is the revenue row counted from the header, and FALSE returns #N/A if the month is misspelled. For "Mar" in A5 this returns 18500. HLOOKUP is the right tool for sideways tables, returning values from a row beneath a header you search across — the horizontal counterpart to VLOOKUP. If there is any chance you will reuse this, drop it into a small template tab right now: a labelled input area on the left and the formula beside it, checked once against the tool above. Next time the same question comes up, the answer is a single paste away instead of a rebuild from memory.
In Google Sheets
Everything above works in Google Sheets too. Excel and Sheets share the formula syntax used here; only the surrounding menus are arranged differently. That portability is deliberate — learn it once and it follows you between the two tools and across Windows and Mac. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top, the tool proves it, and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. Here is the takeaway for “excel function hlookup”: copy the answer if you are busy, but if you have a spare few minutes, rebuild the example in Excel yourself with the tool above open beside it. That single pass — type it, run it, watch the result move when you change an input — is what turns a formula you found into a technique you trust. Keep your inputs labelled and referenced, never hard-coded, and the same sheet stays correct and auditable as it grows. Done that way, you will not need to look this up again, and you will be the person others ask.
Common mistakes
- Leaving off FALSE, so
HLOOKUPdoes an approximate match and returns the wrong column when the header row is not sorted. - Counting row_index_num from worksheet row 1 instead of from the top of table_array.
- Using
HLOOKUPon a vertical table — if the labels run down a column rather than across a row, useVLOOKUPinstead.
Frequently asked questions
When should I use HLOOKUP instead of VLOOKUP?
Use HLOOKUP when your data is laid out horizontally, with the values you search across a top row and the answers in rows below. For the more common vertical layout, where labels run down a column, use VLOOKUP.
Why does HLOOKUP return #N/A?
The lookup value was not found in the top row. Check for stray spaces, text-versus-number mismatches, or a misspelled value, and make sure you included FALSE so an approximate match is not silently returning the wrong column.
Can XLOOKUP replace HLOOKUP?
Yes. XLOOKUP searches in any direction, so it handles horizontal lookups too and defaults to an exact match, making it a cleaner replacement where your Excel version supports it.