How to hlookup
Content on WhatAnswers is provided "as is" for informational purposes. While we strive for accuracy, we make no guarantees. Content is AI-assisted and should not be used as professional advice.
Last updated: April 4, 2026
Key Facts
- HLOOKUP searches horizontally across the top row of a data range.
- It returns a value from a specified row within the same column where a match is found.
- The function requires a lookup value, a table array, a row index number, and a range lookup argument.
- The range lookup argument (TRUE/FALSE or 1/0) determines if an approximate or exact match is needed.
- HLOOKUP is less commonly used than VLOOKUP due to data often being organized vertically.
What is HLOOKUP?
The HLOOKUP function, short for Horizontal Lookup, is a powerful tool found in spreadsheet applications like Microsoft Excel and Google Sheets. It is designed to search for a specific value within the first row of a table or range of cells and then return a corresponding value from a row that you specify, located in the same column where the match was found. Think of it as searching across a spreadsheet horizontally, rather than down a column as VLOOKUP does.
How Does HLOOKUP Work?
The HLOOKUP function has the following syntax:
HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])Understanding the Arguments:
- lookup_value: This is the value you want to search for in the first row of your table. It can be a number, text, a logical value, or a cell reference containing the value.
- table_array: This is the range of cells that contains the data you want to search within. The first row of this range is where HLOOKUP will look for the
lookup_value. - row_index_num: This is a number that specifies which row in the
table_arraycontains the value you want to return. The first row is row 1, the second row is row 2, and so on. - [range_lookup]: This is an optional argument that specifies whether you want HLOOKUP to find an approximate match or an exact match.
- TRUE (or omitted): Finds an approximate match. If an exact match is not found, it returns the largest value that is less than or equal to the
lookup_value. The first row of thetable_arraymust be sorted in ascending order for this to work correctly. - FALSE: Finds an exact match. If an exact match is not found, it returns the #N/A error.
- TRUE (or omitted): Finds an approximate match. If an exact match is not found, it returns the largest value that is less than or equal to the
When to Use HLOOKUP
HLOOKUP is most useful when your data is organized horizontally, meaning your headers or identifiers are in the first row, and the data you want to retrieve is in subsequent rows. For example, imagine a table showing monthly sales figures:
| Month | January | February | March |
|---|---|---|---|
| Sales | $10,000 | $12,000 | $15,000 |
| Profit | $2,000 | $2,500 | $3,000 |
If you wanted to find the 'Sales' figure for 'February', you could use HLOOKUP. Your lookup_value would be 'February', the table_array would be the entire table, the row_index_num would be 2 (since 'Sales' is in the second row), and the range_lookup would be FALSE for an exact match.
HLOOKUP vs. VLOOKUP
The primary difference between HLOOKUP and VLOOKUP lies in their search direction. VLOOKUP searches vertically down the first column of a table, while HLOOKUP searches horizontally across the first row. Most data is organized in columns with headers at the top, making VLOOKUP more frequently used. However, when your data is structured with row headers and you need to look up values across columns, HLOOKUP becomes the appropriate choice.
Common Errors and Tips
- #N/A Error: This usually occurs when the
lookup_valueis not found in the first row (whenrange_lookupis FALSE) or when therange_lookupis TRUE and there's no value less than or equal to thelookup_value. - Incorrect
row_index_num: Ensure the row number you specify accurately corresponds to the row containing the desired data within the selectedtable_array. - Sorting for Approximate Match: Remember that if you use an approximate match (TRUE), the first row of your
table_arraymust be sorted in ascending order. - Consider XLOOKUP: Newer versions of Excel and Google Sheets offer the XLOOKUP function, which is more versatile and often replaces both VLOOKUP and HLOOKUP, handling both vertical and horizontal lookups with simpler syntax and better error handling.
By understanding its arguments and application, HLOOKUP can be a valuable function for retrieving specific data points from horizontally arranged datasets.
More How To in Daily Life
Also in Daily Life
More "How To" Questions
Trending on WhatAnswers
Browse by Topic
Browse by Question Type
Sources
- Lookup function - WikipediaCC-BY-SA-4.0
- HLOOKUP function - Microsoft Supportfair-use
- HLOOKUP Function in Excel - ExcelDemyfair-use
Missing an answer?
Suggest a question and we'll generate an answer for it.