Skip to content
Google Sheets

HLOOKUP function in Google Sheets

Horizontal lookup. Searches across the first row of a range for a key and returns the value of a specified cell in the column found.

=HLOOKUP(search_key, range, index, [is_sorted])

HLOOKUP syntax and parameters

Four arguments, three required.

  • search_keyanyRequired

    The value to search for. For example, 42, "Cats", or I24.

  • rangerangeRequired

    The range to consider for the search. The first row in the range is searched for the key specified in search_key.

  • indexnumberRequired

    The row index of the value to be returned, where the first row in range is numbered 1. If index is not between 1 and the number of rows in range, #VALUE! is returned.

  • is_sortedbooleanOptional

    [OPTIONAL - TRUE by default] - Indicates whether the row to be searched (the first row of the specified range) is sorted. If is_sorted is TRUE or omitted, the nearest match (less than or equal to the search key) is returned. If all values in the search row are greater than the search key, #N/A is returned. If is_sorted is set to TRUE or omitted, and the first row of the range is not in sorted order, an incorrect value might be returned. If is_sorted is FALSE, only an exact match is returned. If there are multiple matching values, the content of the cell corresponding to the first value found is returned, and #N/A is returned if no such value is found.

HLOOKUP examples

Formulas you'll actually reuse.

  1. Q3 revenue from a table whose quarters run across the top row (row 3 = revenue):

    =HLOOKUP("Q3", A1:E5, 3, FALSE)

    Result48900

  2. Commission rate for a sale — approximate match against tier thresholds sorted ascending in row 1:

    =HLOOKUP(B2, $A$1:$G$2, 2, TRUE)

    Result0.05

HLOOKUP in Excel

Same name — your formula ports as-is.

Try HLOOKUP in the playground

Edit the example — nothing to install.

Preloaded with the HLOOKUP formula from Example 1 — change anything and watch it respond.

Loading the editor…

HLOOKUP errors

What they mean — and the fixes.

  • #N/A

    No header matched — with FALSE the match is exact, so check spaces and case; use TRUE only when the top row is sorted ascending.