Revenue for a given month
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Month | Jan | Feb | Mar |
| 2 | Revenue | 12000 | 13500 | 15200 |
| 3 | Costs | 8000 | 8200 | 9100 |
Formula: F1: =HLOOKUP("Feb",B1:D3,2,FALSE)
Result: 13500
Finds Feb in the top row of B1:D3 and returns the 2nd row of the table (Revenue).
Same, but searches the first row.
HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])Example: =HLOOKUP("March",A1:M5,3,0)
Available in: All versions
HLOOKUP searches the top row of a table for a value and returns a value from a row below it, in the same column. It is the horizontal version of VLOOKUP, built for data laid out with headers across the top.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Month | Jan | Feb | Mar |
| 2 | Revenue | 12000 | 13500 | 15200 |
| 3 | Costs | 8000 | 8200 | 9100 |
Formula: F1: =HLOOKUP("Feb",B1:D3,2,FALSE)
Result: 13500
Finds Feb in the top row of B1:D3 and returns the 2nd row of the table (Revenue).
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Month | Jan | Feb | Mar |
| 2 | Revenue | 12000 | 13500 | 15200 |
| 3 | Costs | 8000 | 8200 | 9100 |
Formula: F1: =HLOOKUP("Mar",B1:D3,3,FALSE)
Result: 9100
Row index 3 is the Costs row of the table.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Orders from | 0 | 50 | 200 |
| 2 | Discount | 0 | 0.05 | 0.1 |
Formula: A4: =HLOOKUP(120,B1:D2,2,TRUE)
Result: 0.05
120 lies between 50 and 200, so approximate match returns the 50-tier discount of 5%.
A tiny spreadsheet with example data. Edit the formula or any number and see the result.
Formula in G2: =HLOOKUP("Q3",B1:E3,2,FALSE)
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Metric | Q1 | Q2 | Q3 | Q4 | Result | |
| 2 | Revenue | 120 | 135 | 150 | 170 | 150 | |
| 3 | Costs | 80 | 85 | 90 | 100 |
Enter — commit · F2 — edit · F4 — $ in a reference · Ctrl+C/Ctrl+V — copy and paste · Ctrl+Z — undo
Esc or F6 — leave the sheet for the «Check» button · Shift+Tab in the first cell — back to the page