HLOOKUP Function
Looks up a value across rows (horizontal search).
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| lookup_value | The value to find in the first row of the table. | Required |
| table_array | The range containing the data; the first row is searched. | Required |
| row_index_num | The row number within the table (1-based) from which to return a value. | Required |
| range_lookup | TRUE for an approximate match (first row sorted ascending), FALSE for an exact match. Defaults to TRUE. | Optional |
Basic Example
Find quarterly sales
=HLOOKUP("Q2",A1:E5,3,FALSE)HLOOKUP finds "Q2" in row 1, then returns the value in row 3 of that column.
Advanced Examples
Example 1: Exact match lookup
Product codes across the top row, data beneathReturn the price row
=HLOOKUP("X100",A1:G4,4,FALSE)Example 2: Approximate match (sorted)
First row holds sorted thresholdsFind the bracket containing a score
=HLOOKUP(85,A1:E2,2,TRUE)How HLOOKUP Works
HLOOKUP scans the first row of table_array for lookup_value. With range_lookup FALSE it requires an exact match; with TRUE it finds the closest value less than or equal to the lookup in an ascending first row, then returns the corresponding value from row_index_num.
Important Notes & Limitations
Looks only downward within the matched column; it cannot return values from rows above the match row.
Approximate matching (TRUE) requires the first row sorted ascending or results are wrong.
Hard-codes the row position, so inserting rows breaks row_index_num. XLOOKUP avoids this fragility.
Common Errors & Fixes
#N/A errorlookup_value is not found (exact match) or data is unsorted for approximate match.Fix: Verify the key exists, or sort the first row ascending for TRUE.
#REF! errorrow_index_num is greater than the number of rows in table_array.Fix: Reduce row_index_num to a valid row.
Download Practice File
HLOOKUP
hlookupPractice HLOOKUP with Real Data
Download a sample CSV file with pre-populated data and practice exercises for the HLOOKUP function. Works in both Excel and Google Sheets.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps