What you will learn
- Look up a value in a table that goes across
- Choose which row to return
How it works
=HLOOKUP(B5,$B$1:$F$3,2,FALSE) finds the month in B5 in the top row, then returns the value from row 2 of the table.
Formulas at a glance
=HLOOKUP(value, table, row_num, FALSE) | The pattern to follow |
Example
Write the formula to look up the Sales for the month in B5.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Month | Jan | Feb | Mar | Apr | May |
| 2 | Sales | 120 | 135 | 160 | 150 | 180 |
| 3 | Visitors | 40 | 52 | 61 | 58 | 70 |
| 4 | ||||||
| 5 | Month | Mar | Month | May | ||
| 6 | Sales | Sales | ||||
| 7 | Visitors | Visitors |
Click B6 and type =HLOOKUP(B5,$B$1:$F$3,2,FALSE), then press Enter.
The answer is 160.
When to use it
- Tables with months across the top
- Looking up a value in a wide table
- Price lists laid out in rows
Common mistakes
- Using VLOOKUP on a sideways tableIf the labels run across the top, use HLOOKUP.
- Counting the row number wrongCount from the table’s top row, starting at 1.
- Leaving out FALSEAdd FALSE for an exact match.
Practice it on a real sheet
Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.