0
0
Google Sheetsspreadsheet~10 mins

HLOOKUP function in Google Sheets - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

This table shows products in the first row, their prices in the second row, and stock quantities in the third row.

CellValue
A1Product
B1Pen
C1Pencil
D1Eraser
E1Marker
A2Price
B21.5
C20.5
D20.75
E22
A3Stock
B3100
C3200
D3150
E380
Formula Trace
=HLOOKUP("Pencil", A1:E3, 2, FALSE)
Step 1: HLOOKUP("Pencil", A1:E3, 2, FALSE)
Step 2: Search row 1: ["Product", "Pen", "Pencil", "Eraser", "Marker"]
Step 3: Return value from row 2, column 3 (C2)
Cell Reference Map
    A       B       C       D       E
1 |Product | Pen   | Pencil| Eraser| Marker|
2 | Price  | 1.5   | 0.5   | 0.75  | 2.0   |
3 | Stock  | 100   | 200   | 150   | 80    |

Formula looks in row 1 (A1:E1) to find "Pencil" and returns value from row 2 in same column (C2).
The formula searches the first row (A1:E1) for "Pencil" and then returns the value from the second row in the same column.
Result
    A       B       C       D       E
1 |Product | Pen   | Pencil| Eraser| Marker|
2 | Price  | 1.5   | 0.5   | 0.75  | 2.0   |
3 | Stock  | 100   | 200   | 150   | 80    |

F1| 0.5  <- Result of =HLOOKUP("Pencil", A1:E3, 2, FALSE)
The formula returns 0.5, which is the price of "Pencil" found in the second row under the "Pencil" column.
Sheet Trace Quiz - 3 Questions
Test your understanding
What does the HLOOKUP formula search for in the first row?
A"Pencil"
BThe price values
CThe stock quantities
D"Price"
Key Result
HLOOKUP searches the first row of a range for a value and returns the value from a specified row in the same column.