0
0
Google Sheetsspreadsheet~5 mins

HLOOKUP function in Google Sheets - Step-by-Step Guide

Choose your learning style9 modes available
Introduction
The HLOOKUP function helps you find information in a table by looking across the top row. It is useful when your data is organized horizontally and you want to find a value below a matching header.
When you have a table with months as headers in the first row and want to find sales numbers for a specific month.
When you want to get the price of a product listed in the top row of a price list.
When you need to find a student's grade from a row of subjects listed horizontally.
When you want to retrieve data from a horizontal list without rearranging your table.
When you want to quickly match a category name in the first row and get related data below it.
Steps
Step 1: Click
- the cell where you want the result
The cell is selected and ready for input
Step 2: Type
- the formula bar
The formula starts appearing in the selected cell
💡 Start typing =HLOOKUP to see the function suggestion
Step 3: Enter
- the formula bar
The formula syntax appears: =HLOOKUP(search_key, range, index, [is_sorted])
Step 4: Replace
- search_key in the formula
The value you want to find in the top row is set
💡 You can type a value in quotes like "January" or select a cell with that value
Step 5: Replace
- range in the formula
The table range including the top row and rows below is set
💡 Select the cells that include headers and data
Step 6: Replace
- index in the formula
The row number below the top row to get the value from is set
💡 Use 2 for the first row below headers, 3 for the second, and so on
Step 7: Optionally type
- is_sorted in the formula
Set TRUE for approximate match or FALSE for exact match
💡 Usually use FALSE to find exact matches
Step 8: Press
- Enter key
The cell shows the value found below the matching header in the top row
Before vs After
Before
A table with months in row 1: January, February, March; and sales numbers in row 2: 100, 150, 120
After
Using =HLOOKUP("February", A1:C2, 2, FALSE) returns 150 in the selected cell
Settings Reference
search_key
📍 first argument in the HLOOKUP formula
The value to find in the top row of the table
Default: none
range
📍 second argument in the HLOOKUP formula
The table where the function looks for the search_key and returns data
Default: none
index
📍 third argument in the HLOOKUP formula
The row number in the range to return data from, counting from the top row as 1
Default: none
is_sorted
📍 fourth optional argument in the HLOOKUP formula
Defines if the top row is sorted for approximate match (TRUE) or exact match (FALSE)
Default: TRUE
Common Mistakes
Using the wrong row number for the index argument
The index counts from the top row as 1, so using 1 returns the header, not the data
Use 2 to get the first row of data below the headers
Not setting is_sorted to FALSE when data is not sorted
If is_sorted is TRUE or omitted, HLOOKUP may return wrong or approximate results
Always set is_sorted to FALSE for exact matches unless you know the top row is sorted
Selecting a range that does not include the top row
HLOOKUP looks only in the first row of the range for the search_key
Make sure the range includes the top row with headers
Summary
HLOOKUP finds data by searching the top row of a table and returning a value from a specified row below.
Use it when your data is arranged horizontally with headers in the first row.
Remember to set the correct row index and use FALSE for exact matches to avoid errors.