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. Keep the inputs visible and clearly labelled and the whole thing stays auditable — anyone who opens the file later, including you, can see at a glance exactly what feeds the result and change one assumption without hunting through the formula. Treat “use hlookup in excel” 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 cells 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. One habit worth forming early: name the cells that hold your inputs, so the formula reads in plain language instead of a string of cell addresses. A reviewer — or you in three months — can then follow the logic without decoding what B7 and D2 were supposed to mean, which is most of what makes a sheet maintainable.
In Google Sheets
If you are in Google Sheets rather than Excel, the good news is that the formula shown here is identical and the workflow barely changes — menus sit across the top instead of in a ribbon, and a few function names differ slightly, but anything you build here moves across with little or no rework. Nothing on this page is behind a login: the tool runs entirely in your browser, the formula is shown in full with one-click copy, and the steps work the same on Windows and Mac. That is the whole promise here — the exact answer, a way to prove it on your own numbers, and just enough context to make it stick. If you take one thing from this page on “use hlookup in excel”, make it the habit rather than the keystrokes: set the problem up with labelled inputs, reference those cells, and let Excel do the recomputing. Bookmark the page for the syntax, but do the example once in a blank sheet and check it against the tool above — five minutes of hands-on practice fixes the method in memory far better than re-reading, and it surfaces the small snags while they are still harmless. After that the technique is genuinely yours: faster than searching for it again, and reliable enough to drop into work that other people depend on.
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.