HLOOKUP Function

Excel Functions › Lookup & Reference

All Excel versions Lookup & Reference

The Excel HLOOKUP function is VLOOKUP turned sideways: it searches the top row of a table and returns a value from a row below in the same column. Use it when your data runs horizontally — months across the top, metrics down the side — and watch for the same traps that bite VLOOKUP users.


Quick answer: to find "Apr" in the top row of a table and return the value from the table’s 2nd row in that column:
=HLOOKUP("Apr", B1:G4, 2, FALSE)
Always end with FALSE for an exact match — the default is approximate, just like VLOOKUP.

Syntax

=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
ArgumentDescription
lookup_valueRequiredThe value to find in the top row of the table.
table_arrayRequiredThe table to search. The lookup row must be the first row of this range.
row_index_numRequiredThe row number within the table to return from (1 = the lookup row itself, 2 = the next row down, and so on).
range_lookupOptionalFALSE = exact match. TRUE = approximate match (the default!) — requires the top row sorted ascending left to right.

Same trap as VLOOKUP: omit the last argument and HLOOKUP defaults to approximate match — silent wrong answers on unsorted data. Type FALSE every time.

Exact-match lookup across a horizontal table

The table below runs sideways: months across the top, metrics down the side. To get April’s sales, find "Apr" in the top row and return row 2 of the table:

ABCDEFG
1MonthJanFebMarAprMayJun
2Sales$8,200$7,900$8,600$9,100$9,800$10,400
3Expenses$6,100$6,300$6,200$6,500$6,900$7,100
4Profit$2,100$1,600$2,400$2,600$2,900$3,300
=HLOOKUP("Apr", B1:G4, 2, FALSE) // returns $9,100

Change row_index_num to 4 and the same formula returns April’s profit. As with VLOOKUP, wrap in IFERROR to handle missing months gracefully:

=IFERROR(HLOOKUP("Dec", B1:G4, 2, FALSE), "No data")

Try it: interactive HLOOKUP demo

Live demo

Walk the horizontal table above: pick a month and a row, and watch HLOOKUP fetch the value.

Result:

Approximate match: thresholds across the top

With TRUE and a top row sorted ascending left to right, HLOOKUP finds the bracket a number falls into — handy for volume discounts laid out horizontally (quantities 0 / 10 / 50 / 100):

=HLOOKUP(35, B1:E2, 2, TRUE) // 35 falls in the 10+ tier -> 5% discount

Should you still use HLOOKUP?

HLOOKUP has every VLOOKUP limitation, rotated: it can’t look up (only rows below the lookup row), row_index_num breaks when rows are inserted, and the approximate default is dangerous. In Excel 2021+/365, XLOOKUP handles horizontal lookups with the same syntax as vertical ones:

=XLOOKUP("Apr", B1:G1, B2:G2) // horizontal XLOOKUP - no row counting

For older Excel versions, INDEX + MATCH works sideways too:

=INDEX(B2:G2, MATCH("Apr", B1:G1, 0))

Design tip: horizontal layouts are usually harder to maintain than vertical ones. If you control the data, consider transposing it and using VLOOKUP/XLOOKUP — columns grow more gracefully than rows.

Errors & common pitfalls

#N/A — value not found. The value isn’t in the top row, or differs invisibly: stray spaces, text-formatted numbers, or pasted characters. Clean with TRIM or convert text numbers, or wrap in IFERROR.

#REF! — row_index_num too large. Asking for row 5 of a 4-row table. Count only the rows inside table_array.

#VALUE! — row_index_num less than 1. Usually a broken cell reference feeding the row number.

Pitfall: inserted rows shift your answers. row_index_num is a hard-coded count from the top row. Insert a row inside the table and every HLOOKUP silently returns the wrong metric.

Pitfall: only the first match counts. Duplicate headers in the top row? HLOOKUP only ever finds the leftmost one.

Practice workbook

📊
Download the free HLOOKUP practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

What's the difference between HLOOKUP and VLOOKUP?
Direction. VLOOKUP searches the first column of a table and returns from columns to the right; HLOOKUP searches the first row and returns from rows below. Same arguments, same defaults, same traps.
How do I make HLOOKUP an exact match?
Set the fourth argument to FALSE (or 0): =HLOOKUP(value, table, row, FALSE). Without it, HLOOKUP uses approximate match and can silently return the wrong column.
What replaces HLOOKUP in modern Excel?
XLOOKUP handles horizontal lookups with row ranges: =XLOOKUP("Apr", B1:G1, B2:G2). No row counting, exact match by default, and it can return rows above the lookup row.
Can HLOOKUP return a row above the lookup row?
No — only rows below the top row of the table. Use XLOOKUP or INDEX+MATCH, which work in any direction.
Does HLOOKUP support wildcards?
Yes, with exact match (FALSE): * matches any characters and ? matches one. =HLOOKUP("Q*", A1:D5, 2, FALSE) finds the first header starting with Q.

Master functions like this in one day

This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related functions: VLOOKUP · XLOOKUP · INDEX · MATCH