Excel HLOOKUP Function

HLOOKUP searches horizontally across the first row of a table and returns a value from another row in the matching column.

Use it when one value identifies a column and you need related information below that column, such as looking up a product price from a row of product names or a monthly rate from column headers.

1
Choose a value Such as a product code
2
Search the first row Excel finds the matching column
3
Return a related value From a row below

HLOOKUP syntax & arguments

Syntax

=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
Required Optional
  1. 1

    lookup_value

    Required

    The value to find in the first row of the lookup table. It can be text, a number, a cell reference, or the result of another formula.

  2. 2

    table_array

    Required

    The range containing the lookup data. The values being searched must be in the range's first row, and the return row must be inside the same range.

  3. 3

    row_index_num

    Required

    The number of the row to return, counted from the top edge of table_array. The first row is 1, the second is 2, and so on.

  4. 4

    range_lookup

    Optional

    Controls match behavior:

    • FALSE — Exact match: Returns a result only when HLOOKUP finds the lookup value exactly.
    • TRUE — Approximate match: Returns an exact match or the next smallest value. This is the default when the argument is omitted and requires the lookup row to be sorted in ascending order.

Example

=HLOOKUP(A2, E2:J4, 3, FALSE)

Search for A2 within the first row of E2:J4, then return the value from the third row of that same range in the matching column.

HLOOKUP caveats

HLOOKUP is common in older workbooks with horizontal lookup tables, but its rules can produce incorrect results when they are not made explicit.

  • It only looks down

    The lookup value must be in the first row of table_array. HLOOKUP cannot return a value from a row above the lookup row.

  • Exact match is not the default

    Omitting range_lookup uses approximate matching. Include FALSE when you need an exact match.

  • Approximate data must be sorted

    When using TRUE, sort the lookup row in ascending order from left to right. Unsorted data can return a believable but incorrect result.

  • The return row is positional

    row_index_num is a hard-coded position. Changes to the lookup table's rows can change the result or cause a #REF! error.

Working in modern Excel? XLOOKUP is usually more flexible because it supports vertical and horizontal lookups, uses exact matching by default, and does not require a numeric row index. VLOOKUP is the older vertical counterpart to HLOOKUP.

Intro HLOOKUP practice problem

Solve the intro problem directly here, or open it on its own page.

Open full problem

Advanced HLOOKUP practice problems

Use HLOOKUP alongside other Excel functions in realistic, less-prescriptive challenges.