Lookup & Reference

HLOOKUP Function in Excel

Searches for a value in the top row of a table and returns a value in the same column from a row you specify.

Syntax

  • =HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])

Arguments

  • lookup_value (required): The value to search for in the first row
  • table_array (required): The range containing the data
  • row_index_num (required): The row number to return from
  • range_lookup (optional): TRUE for approximate match, FALSE for exact match

Examples

  • =HLOOKUP("Q1", A1:E5, 3, FALSE) - Find Q1 column and return row 3 value - Result: $15,000
  • =HLOOKUP(2024, A1:M10, 5, FALSE) - Look up year and return row 5 - Result: Revenue data

Excel HLOOKUP function documentation

  • HLOOKUP (Horizontal Lookup) searches the top row of a table and returns a value from a specified row below.
  • Syntax: =HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup]).
  • Mirror of [VLOOKUP](/functions/vlookup/) which searches the leftmost column — use HLOOKUP when keys are in row 1.
  • Modern alternative: [XLOOKUP](/functions/xlookup/) with horizontal lookup_array and return_array.

HLOOKUP syntax and arguments

  • lookup_value: value to find in the first row of table_array.
  • table_array: range where row 1 is the lookup row and rows below hold return values.
  • row_index_num: which row within table_array to return (1 = first row, 2 = second row, etc.).
  • range_lookup: FALSE or 0 for exact match (recommended); TRUE for approximate on sorted first row.

Step-by-step: first HLOOKUP on a horizontal header table

  • Step 1 — Put month names across row 1 (Jan, Feb, Mar…) and metrics in rows 2–5.
  • Step 2 — Put the month to find in A10 (e.g. "Mar").
  • Step 3 — Revenue in row 2: =HLOOKUP(A10, $A$1:$M$5, 2, FALSE).
  • Step 4 — Lock table_array with $ before filling the formula across other metrics.
  • Step 5 — Spot-check two known months; switch to XLOOKUP if keys are not in row 1.

HLOOKUP vs VLOOKUP vs XLOOKUP

  • HLOOKUP — keys in top row; limited to legacy horizontal layouts.
  • VLOOKUP — keys in left column; most common legacy vertical lookup.
  • XLOOKUP — works in any direction; preferred for new Microsoft 365 workbooks.
  • Compare: [XLOOKUP vs VLOOKUP](/compare/xlookup-vs-vlookup/) · Tutorial: [VLOOKUP guide](/functions/vlookup/).

Worked examples to copy

  • Quarterly metric: =HLOOKUP("Q2", $A$1:$E$10, 4, FALSE) returns row 4 value under Q2.
  • Product column from header: =HLOOKUP(D2, $B$1:$Z$3, 2, FALSE) when SKUs are columns.
  • With IFERROR: =IFERROR(HLOOKUP(A2,Table,3,FALSE), "N/A") — prefer IFNA for lookups only.
  • Migrate to XLOOKUP: =XLOOKUP(A2, B1:Z1, B2:Z2) when headers are horizontal.

People also ask

  • When to use HLOOKUP? — When lookup values are in the first row and return data is below.
  • Why HLOOKUP #N/A? — Wrong row index, approximate match on unsorted row, or missing header.
  • Is HLOOKUP deprecated? — Not removed, but XLOOKUP and INDEX MATCH are more flexible.
  • HLOOKUP row_index_num off by one? — Count includes the header row as row 1 of table_array.

Common errors

  • #N/A when value not found
  • #REF! when row index exceeds range

Use cases

  • Horizontal data tables
  • Time-series data
  • Matrix lookups

Frequently asked questions

  • What is HLOOKUP and when should I use it? HLOOKUP (Horizontal Lookup) searches for a value in the first row of a table and returns a value from a specified row. Use it when your data is arranged horizontally with headers in the first row. For vertical data, use VLOOKUP instead.
  • What is the difference between HLOOKUP and VLOOKUP? VLOOKUP searches vertically (in columns) while HLOOKUP searches horizontally (in rows). Use VLOOKUP when lookup values are in the first column; use HLOOKUP when lookup values are in the first row.
  • Why should I use XLOOKUP instead of HLOOKUP? XLOOKUP is more flexible than HLOOKUP: it can search in any direction, has built-in error handling, and doesn't require counting rows. If you have Excel 365 or 2021, XLOOKUP is the better choice.
  • How do I fix #REF! error in HLOOKUP? The #REF! error occurs when row_index_num is larger than the number of rows in table_array. Check that your row index doesn't exceed the table height.
  • Can HLOOKUP search from right to left? No, HLOOKUP always searches from left to right in the first row. To search right to left, use XLOOKUP or combine INDEX with MATCH.

Editorial review

  • Reviewed by Excel.Directory Editorial Team. Updated May 2026.

When to use HLOOKUP

  • Horizontal data tables — common Lookup & Reference scenario for HLOOKUP.
  • Time-series data — common Lookup & Reference scenario for HLOOKUP.
  • Matrix lookups — common Lookup & Reference scenario for HLOOKUP.

HLOOKUP in the Lookup & Reference category

  • Browse all Lookup & Reference functions at /categories/lookup-reference/ for related formulas.
  • HLOOKUP syntax: =HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
  • lookup_value (required): The value to search for in the first row
  • table_array (required): The range containing the data
  • row_index_num (required): The row number to return from
  • range_lookup (optional): TRUE for approximate match, FALSE for exact match
  • Confirm HLOOKUP arguments match the syntax shown above before filling down.
  • Lock table and range references with $ when copying formulas across rows or sheets.

Formula checklist before you copy down

  • Confirm HLOOKUP arguments match the syntax shown above before filling down.
  • Lock table and range references with $ when copying formulas across rows or sheets.
  • If results look wrong, check for text stored as numbers and invisible spaces with TRIM.
  • Spot-check three known input rows manually against expected output.

Related Excel functions

  • VLOOKUP (/functions/vlookup/): Looks for a value in the leftmost column of a table, and then returns a value in the same row from a column you specify.
  • XLOOKUP (/functions/xlookup/): Searches a range or an array, and returns an item corresponding to the first match it finds. If a match doesn't exist, XLOOKUP can return the closest (approximate) match.
  • INDEX (/functions/index/): Returns the value of an element in a table or array, selected by the row and column number indexes.
  • MATCH (/functions/match/): Returns the relative position of an item in an array that matches a specified value.

Errors to watch for

  • #N/A when value not found — review causes on linked error pages in the directory.
  • #REF! when row index exceeds range — review causes on linked error pages in the directory.

Copy-paste audit workflow

  • Enter HLOOKUP on three test rows with known expected output documented on a QA tab.
  • Fill down only after absolute references are locked on lookup tables and rate tables.
  • Compare against manual calculation or a calculator for financial and statistical functions.
  • Search this directory for comparison guides when choosing between similar functions in the same category.

HLOOKUP worked examples to copy

  • =HLOOKUP("Q1", A1:E5, 3, FALSE) — Find Q1 column and return row 3 value. Expected result: $15,000.
  • =HLOOKUP(2024, A1:M10, 5, FALSE) — Look up year and return row 5. Expected result: Revenue data.

HLOOKUP reference summary for crawlers and offline review

  • HLOOKUP belongs to the Lookup & Reference category in Excel. Searches for a value in the top row of a table and returns a value in the same column from a row you specify.
  • Full syntax: =HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup]). Open /functions/hlookup/ for parameters, FAQs, and related pages.
  • Common mistakes: #N/A when value not found; #REF! when row index exceeds range
  • Pair this function with comparison guides when another Excel formula might fit the same task better.
  • Review fix-excel-formula-errors when unexpected errors appear after upgrading Excel or sharing across locales.