HLOOKUP(search_key, range, index, [is_sorted])One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.
search_key:
The value that you want to search for in the first row of the specified range.
range:
The range of cells that contains the data you want to search through. The first row of this range is where the search_key will be looked up.
index:
The row number in the range from which to return the value. The first row is 1, the second row is 2, and so on.
is_sorted:
An optional parameter that indicates whether the first row of the range is sorted. If TRUE or omitted, an approximate match is returned; if FALSE, an exact match is required.
The HLOOKUP function in Google Sheets is a useful tool that allows you to search for a value in the first row of a range or array and return a corresponding value from a specified row within that range. It is particularly helpful when dealing with horizontal data layouts, making it easier to retrieve information from tables organized in rows.
In simpler terms, HLOOKUP enables you to find specific data in a horizontal table and retrieve related information from that table efficiently.
Imagine you are managing a student database with their scores stored in a Google Sheets spreadsheet:
| StudentID | Name | Math | Science | English |
|---|---|---|---|---|
| 001 | Alice | 85 | 90 | 88 |
| 002 | Bob | 78 | 82 | 80 |
| 003 | Charlie | 92 | 95 | 94 |
You want to find the score of each student in a specific subject.
To achieve this, you would use the HLOOKUP function as follows:
=HLOOKUP("Math", Students!A1:E4, 3, FALSE)In this formula:
"Math" is the value you are searching for in the first row of the Students Table.Students!A1:E4 is the range where the function will look for the subject name and return the corresponding scores.3 indicates that you want to return the value from the third row of the specified range.FALSE specifies that you want an exact match for the search.When you apply the HLOOKUP formula, the output would show the Math scores as follows:
| Subject | Score |
|---|---|
| Math | 85 |
| Math | 78 |
| Math | 92 |
If you were to change the subject in the HLOOKUP formula to "Science", the result would update accordingly:
=HLOOKUP("Science", Students!A1:E4, 3, FALSE)This would return:
| Subject | Score |
|---|---|
| Science | 90 |
| Science | 82 |
| Science | 95 |
HLOOKUP is beneficial because it simplifies the process of looking up data in horizontal tables. It allows for quick retrieval of information without the need for complex formulas. However, it is important to note that HLOOKUP can only search for values in the first row of the specified range, which may limit its versatility compared to other lookup functions.
HLOOKUP is a valuable function for anyone working with horizontal data in Google Sheets, providing a straightforward way to enhance data analysis and reporting capabilities.
Happy spreadsheeting!
You have a table where Row 1 contains product IDs and Row 2 contains their corresponding prices. You can use HLOOKUP to enter a product ID and quickly retrieve its price. This streamlines pricing queries and enhances inventory management efficiency.
Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.
Browse our complete library of Google Sheets formula guides
Compare your options
Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.
AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.