# HLOOKUP function in Excel

> HLOOKUP is VLOOKUP turned sideways: it searches the top row of a table for a value and returns a value from a row below it, in the same column.

Source: https://spreadsheetpractice.com/functions/hlookup · Updated October 28, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

## Quick answer

- **What it does:** HLOOKUP is VLOOKUP turned sideways: it searches the top row of a table for a value and returns a value from a row below it, in the same column.
- **Syntax:** `=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])`
- **Most common use:** `=HLOOKUP("Q2",A1:E3,2,FALSE)` returns $135,000 (The Q2 target, from row 2 of the table)
- **Available in:** Every current version
- **Category:** [Lookup functions](https://spreadsheetpractice.com/functions/category/lookup)
- **Returns:** The value from the matching column, or #N/A when there is no match.
- **Google Sheets:** Works the same way in Google Sheets.

## What it does

HLOOKUP is VLOOKUP turned sideways: it searches the top row of a table for a value and returns a value from a row below it, in the same column. Use it for tables laid out with labels across the top, such as months or quarters in columns. In Excel 2021 or later, XLOOKUP does the same job with less to go wrong.

## Syntax

`=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])`

| Argument | Required? | What it is |
|---|---|---|
| `lookup_value` | Required | The value to find in the top row of the table. |
| `table_array` | Required | The table to search. The row you search must be its top row. |
| `row_index_num` | Required | Which row of the table to return, counting the top row as 1. |
| `range_lookup` | Optional | FALSE for an exact match. TRUE or left out for an approximate match, which needs the top row sorted smallest to largest. |

## Examples

Each result was calculated by running the formula on the sample sheet.

| Cell | Formula | Result | What it shows |
|---|---|---|---|
| G2 | `=HLOOKUP("Q2",A1:E3,2,FALSE)` | $135,000 | The Q2 target, from row 2 of the table |
| G3 | `=HLOOKUP("Q3",A1:E3,3,FALSE)` | $149,000 | The Q3 actual, from row 3 |
| G4 | `=HLOOKUP("Q5",A1:E3,2,FALSE)` | #N/A | There is no Q5 column, so it returns the #N/A error |

### The sample sheet

Every formula above runs on this data:

|  | A | B | C | D | E | F | G |
|---|---|---|---|---|---|---|---|
| 1 | Quarter | Q1 | Q2 | Q3 | Q4 |  | Result |
| 2 | Target | $120,000 | $135,000 | $150,000 | $170,000 |  | $135,000 |
| 3 | Actual | $118,400 | $141,200 | $149,000 |  |  | $149,000 |
| 4 |  |  |  |  |  |  | #N/A |

## Common mistakes

| What you see | Why, and how to fix it |
|---|---|
| A wrong answer with no error | range_lookup was left out, so HLOOKUP did an approximate match. Add FALSE as the fourth argument. |
| #REF! | row_index_num is larger than the number of rows in table_array. Extend the range down or lower the number. |
| Results shift after inserting a row | row_index_num doesn't move with the table. XLOOKUP and INDEX/MATCH reference the return row directly. |

## Tips

- If you control the layout, store months down a column instead: most Excel tools, from filters to pivot tables, work better with data in columns.

## Related functions

- [VLOOKUP](https://spreadsheetpractice.com/functions/vlookup): VLOOKUP looks for a value in the first column of a table and returns a value from another column in the same row.
- [XLOOKUP](https://spreadsheetpractice.com/functions/xlookup): XLOOKUP searches one column or row for a value and returns the matching item from another.
- [INDEX](https://spreadsheetpractice.com/functions/index): INDEX returns the value at a given row and column of a range: INDEX(A2:C10,4,2) is the fourth row, second column.
- [MATCH](https://spreadsheetpractice.com/functions/match): MATCH returns the position of a value in a row or column: 3 means the third cell.

## Questions

### What is the difference between VLOOKUP and HLOOKUP?

VLOOKUP searches down the first column and returns from a column to the right. HLOOKUP searches across the top row and returns from a row below.

### What can I use instead of HLOOKUP?

XLOOKUP works across rows too: =XLOOKUP("Q2",B1:E1,B2:E2). In older versions, INDEX with MATCH on the header row does the same.

## Practice

A graded HLOOKUP exercise ("Sign-ups for a month") is on [the HLOOKUP page](https://spreadsheetpractice.com/functions/hlookup). It is checked instantly, then re-checked on changed data.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
