HLOOKUP function in Excel
HLOOKUP finds a value in the top row of a table and returns a value from the same column in a row below.
HLOOKUP is VLOOKUP turned on its side. The H stands for horizontal. Use it when the headings run across the top of the table and the data sits in rows below them, as in a sheet with one column for each month.
Syntax
=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])| Argument | What it is |
|---|---|
lookup_value | The value to look for in the top row of the table. |
table_array | The table to search. Its top row must hold the values you are looking up. |
row_index_num | Which row of the table to return, counted from the top of the table. The top row is 1. |
range_lookup | FALSE for an exact match. TRUE, or left out, for an approximate match on a top row sorted from left to right. |
Examples
Each result below is what Excel itself showed for the formula on the sample sheet.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Month | Jan | Feb | Mar | Apr | May | Jun |
| 2 | Sales | 4700 | 2700 | 5250 | 2300 | 3750 | 4100 |
| 3 | Target | 4000 | 3000 | 5000 | 3000 | 3500 | 4000 |
=HLOOKUP("Mar",A1:G3,2,FALSE)Result: 5250Finds Mar in the top row and returns the 2nd row of that column: the sales for March.
=HLOOKUP("Mar",A1:G3,3,FALSE)Result: 5000The 3rd row of the same column: the target for March.
=HLOOKUP("May",A1:G3,2,FALSE)-HLOOKUP("May",A1:G3,3,FALSE)Result: 250Sales minus target for May, using two lookups.
=HLOOKUP("Jul",A1:G3,2,FALSE)Result: #N/AThere is no July in the top row, so the answer is #N/A.
How it works
HLOOKUP searches along the top row of the table for the lookup value. When it finds it, it moves down that column to the row number you gave and returns the value there. Row 1 is the top row of the table you selected, whatever its row number on the sheet.
Everything said about VLOOKUP's last argument applies here too. Type FALSE unless you really want an approximate match, in which case the top row must be sorted from smallest to largest, left to right.
When do tables run sideways?
Most data is stored downwards, one record per row, and for that VLOOKUP is the tool. Sideways tables appear in reports and summaries:
- months or years across the top of a budget;
- days of the week across a timetable;
- a small rate table laid out in one row to save space.
If you are designing a sheet yourself, store the data downwards. It is easier to sort, filter and add to. Keep the sideways layout for the final report.
Limits
- The lookup value must be in the top row of the table, and the answer must be below it.
- The row number is fixed. Insert a row inside the table and the formula returns the wrong row.
- Only the first matching column is used.
XLOOKUP removes all three limits and works in both directions, so in a recent version of Excel you may never need HLOOKUP. It is still worth knowing, because many existing workbooks use it.
Picking the row by its label
A neat upgrade is to let MATCH find the row number, so the formula does not depend on a typed figure: =HLOOKUP("Mar",A1:G3,MATCH("Target",A1:A3,0),FALSE). Now the formula still works if a row is added.
In Google Sheets
HLOOKUP is the same in Google Sheets.
Related functions
Every result on this page was calculated in Microsoft Excel (version 16.0, build 20326) on 12 November 2026, not typed by hand.
This is an independent help site. It is not connected with or approved by Microsoft. Excel and Microsoft 365 are trademarks of Microsoft Corporation, named here only to say which program a formula is for. The people and figures in the sample sheets are made up.