HLOOKUP Function in Microsoft Excel: Formula, Examples & Troubleshooting
Learn the HLOOKUP formula in Microsoft Excel: search a header row and return a value beneath the match, with reproducible examples, expected answers and compatibility cautions.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: HLOOKUP searches the top row of a table and returns a value from a chosen row in the same column. Set the final argument to FALSE for exact lookup. TRUE or omission uses ascending sorted boundaries and approximate matching.
Availability and version history
- Introduced: Introduction version not established by the official history reviewed.
- Availability: Official help lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016.
- Checked: October 14, 2026; official HLOOKUP reference. Documentation check, not a new native test; existing example-verification notes retain their scope.
Syntax and original practice data
=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
Square brackets mark optional arguments and are not typed. Examples use English function names and comma separators. Enter the original data below in A1:F9, with the Row column used only as an explanatory label. Amount and Units are numbers; other fields are text. Keep formula outputs outside the source table.
| Row | A · Item | B · Team | C · Status | D · Amount | E · Units | F · Agent |
|---|---|---|---|---|---|---|
| 1 | Item | Team | Status | Amount | Units | Agent |
| 2 | Pen | East | Paid | 120 | 12 | Ana |
| 3 | Pad | West | Pending | 75 | 5 | Bo |
| 4 | Box | East | Paid | 210 | 7 | Ana |
| 5 | Tape | North | Paid | 90 | 0 | Cy |
| 6 | Folder | West | Paid | 150 | 3 | Bo |
| 7 | Pen | East | Pending | 60 | 8 | Dee |
| 8 | Pad | West | Paid | 125 | 12 | Ana |
| 9 | Box | North | Pending | 80 | 4 | Cy |
Two original worked examples
=HLOOKUP("Amount",A1:F9,3,FALSE)
=HLOOKUP("Team",A1:F9,2,FALSE)
Expected results are 75 and East. Amount is in column D, and row 3 of A1:F9 contains the second order. Team is in column B, and row 2 contains East.
The return index counts from the top of the supplied table, including a header row if it lies inside that range. It is not inherently a worksheet row number.
Advanced check: change the table origin
=HLOOKUP("East",A2:F9,2,FALSE)
The top row of this smaller range is the original first order. East is its unique entry in column B. The second row of the smaller range is worksheet row 3, so the expected result is West.
This is a position demonstration, not a recommended order identifier. A real horizontal lookup table should place stable comparable keys across its first row.
Advanced example: use a complete horizontal table
On a separate sheet, enter A1:D3:
| Row | A | B | C | D |
|---|---|---|---|---|
| 1 | Field | P-100 | P-200 | P-300 |
| 2 | Price | 12 | 18 | 25 |
| 3 | Stock | 7 | 0 | 9 |
The Row column is explanatory, not an extra worksheet column. Then:
=HLOOKUP("P-200",B1:D3,2,FALSE)
=HLOOKUP("P-200",B1:D3,3,FALSE)
Expected results are 18 and 0. Zero stock is present data; an exact lookup for missing P-999 instead has documented expected #N/A.
The input includes the key row. Selecting B2:D3 would make numeric prices the search row and answer a different question. Confirm the range before interpreting a plausible returned value.
Advanced example: choose the output row by its label
=HLOOKUP("P-300",B1:D3,MATCH("Stock",A1:A3,0),FALSE)
MATCH finds Stock at position 3, so the expected result is 9. The label range starts on the same worksheet row as the horizontal lookup table.
If MATCH used A2:A3, Stock would have position 2 and the formula would incorrectly select price 25. A dynamic index is only useful when the source origins align. See MATCH for exact-position lookup.
Advanced example: sorted thresholds across a row
On another sheet, put numeric boundaries 0,10,20,50 in A1:D1 and labels Starter,Standard,Plus,Bulk in A2:D2:
=HLOOKUP(35,A1:D2,2,TRUE)
=HLOOKUP(35,A1:D2,2)
Both expected results are Plus, from boundary 20. Query 20 selects its exact boundary; 50 and 75 select Bulk. Query −1 is smaller than the lowest boundary and has documented #N/A.
With FALSE, 35 has no exact match and also produces #N/A. Approximate mode requires ascending order from left to right. Do not leave the flag omitted on an unsorted identifier table because one successful test happens to return the intended result.
Text comparison and wildcard controls
Microsoft explicitly treats uppercase and lowercase text as equivalent. In the separate price table, =HLOOKUP("p-200",B1:D3,2,FALSE) therefore has documented-model expected result 18.
With FALSE, ? matches one character and * a sequence. =HLOOKUP("P-3??",B1:D3,2,FALSE) has expected result 25. A tilde before an asterisk or question mark requests that literal character rather than a wildcard.
These are Excel wildcard rules, not regular expressions. A regex such as ^P-3.*$ should not be substituted into this formula as though the two pattern systems had identical meaning.
Return-index errors and debugging
For the three-row price table, row index 0 is below one and has documented expected #VALUE!. Row index 4 exceeds its height and has documented #REF!. An absent exact key has #N/A; these error categories describe different problems.
The current reference does not establish every duplicate-header, blank-return, fractional-index or mixed-type behavior. Keep lookup headers unique and test any required edge in the intended Excel client.
For vertical keys, VLOOKUP uses a column index rather than a row index. XLOOKUP has different defaults and availability, so migration requires reviewing its own function guide rather than only renaming the formula.
Product-specific troubleshooting and verification
Microsoft documents Formulas → Evaluate Formula for Excel for Windows. If that command is unavailable in your client, inspect component expressions in helper cells and compare their results. This qualification does not imply the same menu exists on every platform listed above.
Related guides already published for this function: LibreOffice Calc | Apache OpenOffice Calc | Gnumeric
A corresponding guide establishes separate documentation, not guaranteed identical defaults or file-conversion behavior. See the function comparison tool and editorial testing standards.
The complete manuscript, original source table and all original formulas were reviewed on October 14, 2026. New outputs were independently calculated from explicit inputs. The existing approved availability/history section is retained exactly. No native Excel execution or complete client/type/error matrix is claimed.