Horizontal Lookup with HLOOKUP

Excel Formulas › Lookup

All versionsHLOOKUPXLOOKUP alt

When your data runs across instead of down — months in a header row, categories along the top — HLOOKUP searches the first row and returns a value from a row below. It’s VLOOKUP turned on its side.


Quick formula: to find the value under the header in E2, from row 3 of the table:
=HLOOKUP(E2, A1:D3, 3, FALSE)
Search the header row for E2, then drop down to row 3 of the table. FALSE forces an exact match.

Functions used (tap for the full reference guide):

The example

Months across the top; look up Mar and return its Sales row.

ABCD
1MetricJanFebMar
2Units100140120
3Sales$1,000$1,400$1,200

The formula

March sales (row 3 of the table):

=HLOOKUP("Mar", A1:D3, 3, FALSE) // finds Mar across the top → $1,200

How it works

HLOOKUP works like VLOOKUP but sideways:

  1. It searches the first row of the table (A1:D3) for the lookup value — “Mar.”
  2. The row index 3 says “return the value from the 3rd row of the table” in that column — the Sales figure.
  3. FALSE requires an exact header match (use TRUE only for sorted numeric breakpoints).
  4. The result is the cell where the Mar column meets the Sales row — $1,200.

XLOOKUP replaces both. =XLOOKUP(E2, A1:D1, A3:D3) does a horizontal lookup without a row-index number, and the same function handles vertical lookups too — one function for every direction.

Try it: interactive demo

Live demo

Pick a month and which row to return.

Result:

Variations

XLOOKUP horizontal

No row number needed:

=XLOOKUP(E2, A1:D1, A3:D3)

Two-way (row and column)

HLOOKUP with a MATCH for the row:

=HLOOKUP(E2, A1:D3, MATCH(E3, A1:A3, 0), FALSE)

Approximate (sorted breakpoints)

For a horizontal rate band:

=HLOOKUP(value, A1:D2, 2, TRUE)

Pitfalls & errors

#N/A. The header isn’t found exactly — usually a trailing space or different text. Confirm with =E2=C1 and TRIM if needed.

Row index is 1-based within the table. Row 1 is the header row itself; the first data row is index 2. Count from the top of the table range, not the sheet.

HLOOKUP only looks down from the header row. Like VLOOKUP, it can’t return a value above the search row — XLOOKUP can.

Practice workbook

📊
Download the free Horizontal Lookup with HLOOKUP practice workbook
A horizontal table with live HLOOKUP, the XLOOKUP and two-way variants, plus 4 challenges with answers. No sign-up required.

Frequently asked questions

How do I do a horizontal lookup in Excel?
Use HLOOKUP: =HLOOKUP(value, table, row_index, FALSE). It searches the first row for the value and returns the cell from the specified row below. FALSE forces an exact match.
What's the difference between HLOOKUP and VLOOKUP?
HLOOKUP searches across the first row and returns a value from a row below; VLOOKUP searches down the first column and returns a value from a column to the right. XLOOKUP replaces both.
How do I do a two-way lookup with HLOOKUP?
Use MATCH for the row index: =HLOOKUP(E2, table, MATCH(E3, row_labels, 0), FALSE) finds both the column header and the row label.

Stop fighting formulas. Learn them in a day.

This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related formulas: Two-way lookup · 2-D INDEX/MATCH/MATCH · Lookup with multiple criteria

Function references: HLOOKUP · XLOOKUP