fxExcelReps
PRO

You've used your 3 free functions

To practise HLOOKUP and every other function, get a PRO subscription.

  • Unlimited access to every function
  • New functions and exercises every month
  • Every mistake explained + full solutions

Your free functions — you can always come back to these:

← All functions

How to use HLOOKUP in Excel

HLOOKUP is VLOOKUP turned sideways: it searches the first row of a table and returns a value from a row below. Use it when the data runs across, like months or quarters in columns.

Syntax

=HLOOKUP(lookup_value, table_array, row_index_num, FALSE)

lookup_valueWhat to look for in the first row.
table_arrayThe table, starting with the header row.
row_index_numWhich row to return: 1 = header row, 2 = the next…
range_lookupFALSE for an exact match.

Examples

=HLOOKUP("Q3", B1:E3, 2, FALSE)Sales for Q3 from a quarterly table.
=HLOOKUP(B5, $B$1:$M$4, 3, FALSE)Costs for the month in B5.

Look up a month in a report row

HLOOKUP searches the first row of a table and returns a value from a row below it. It fits reports where the months or quarters run across the top.

=HLOOKUP("Mar", $B$1:$M$5, 3, FALSE)The March value from the 3rd row of the table.
=HLOOKUP(P1, $B$1:$M$5, MATCH(P2, $A$1:$A$5, 0), FALSE)Month in P1, line item in P2: MATCH picks the row so you don't count rows by hand.

HLOOKUP vs XLOOKUP across

XLOOKUP works horizontally too: point it at the header row and the row to return. There's no row number to break when someone inserts a row.

=HLOOKUP(P1, $B$1:$M$5, 3, FALSE)The classic way.
=XLOOKUP(P1, $B$1:$M$1, $B$3:$M$3)The same with XLOOKUP, in Microsoft 365 and Excel 2021.

Common mistakes

Same pitfalls as VLOOKUP
Missing FALSE, values not found, rows that shift when you insert one.
Modern alternative
XLOOKUP works both vertically and horizontally.

Frequently asked questions

What's the difference between VLOOKUP and HLOOKUP?

VLOOKUP searches down the first column, HLOOKUP across the first row. Everything else, including the FALSE at the end, works the same.

Why does HLOOKUP return the wrong value?

The last argument is missing, so HLOOKUP does an approximate match. Always end with FALSE. The same trap is shown step by step in VLOOKUP vs XLOOKUP.

Why does HLOOKUP return #REF!?

The row number is larger than the number of rows in the table: asking for row 6 of a 5-row table.

Can HLOOKUP look up?

No, it only returns rows below the first row. Use INDEX with MATCH or XLOOKUP to look in any direction.

Available in: All versions of Excel, Excel for the web, Google Sheets

Related functions

VLOOKUPXLOOKUPINDEX