Home / Guides / How to Use HLOOKUP in Excel

How to Use HLOOKUP in Excel

Excel Functions · Updated June 2026

HLOOKUP searches for a value in the top row of a table and returns a value from a row you specify in the same column. The H stands for horizontal, so it scans across columns rather than down rows. It suits data laid out with labels in the first row and periods running left to right, which is common in financial summaries.

Syntax and how HLOOKUP works

The signature is =HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup]). The function looks for lookup_value in the first row of table_array, then moves down that matching column by row_index_num rows and returns the value it finds.

The row_index_num is counted from the top of the table, where the header row itself is row 1. So row_index_num of 3 returns the value two rows below the matched header. The fourth argument controls match type: FALSE forces an exact match, while TRUE or an omitted argument does an approximate match that assumes the top row is sorted ascending.

Worked example: pull a metric by quarter

Quarters sit across the top in B1:E1 as Q1 through Q4. Revenue is in row 2, gross profit in row 3, and net income in row 4. You want Q3 net income.

  1. Confirm the header row holds the quarter labels: B1:E1 contains Q1, Q2, Q3, Q4.
  2. Net income is the fourth row of the block, so row_index_num is 4 counting from row 1.
  3. Enter =HLOOKUP("Q3", B1:E4, 4, FALSE).
  4. Excel finds Q3 in column D, drops to the fourth row, and returns 1500.
LabelQ1Q2Q3Q4
Revenue10000110001200013000
Gross profit6000660072007800
Net income1200135015001650

Q3 is the matched column and net income is row 4 of the table, so the result is 1500.

How analysts use HLOOKUP in models

HLOOKUP fits time series that run across the page, which is the standard layout for forecast and actuals blocks.

Common pitfalls

HLOOKUP is fragile because row_index_num is a hardcoded position. Insert a row inside the table and the count no longer points where you intended, so the formula silently returns the wrong line. It also only looks in the first row of the range, so the metric you search on must sit at the very top.

For most work, VLOOKUP or XLOOKUP is safer because financial data is usually arranged in columns and XLOOKUP returns a value from a named return range rather than a positional offset. Reach for HLOOKUP only when the data is genuinely horizontal and you cannot transpose it.

Do it in one click

Formula Trace

Formula Trace shows which cells an HLOOKUP feeds so you can see when a shifted row_index_num points at the wrong line.

Get ModelMint See how it works

FAQ

What is the difference between HLOOKUP and VLOOKUP?

HLOOKUP searches across the top row and returns a value from a row below it, while VLOOKUP searches down the first column and returns a value from a column to the right. Use HLOOKUP when periods run horizontally.

Why does HLOOKUP return the wrong value?

The most common cause is leaving the fourth argument out or set to TRUE, which does an approximate match. Pass FALSE to force an exact match. A shifted row_index_num after inserting rows is the other frequent cause.

Should I still use HLOOKUP or switch to XLOOKUP?

If you have Excel 365 or 2021, XLOOKUP is more robust because it returns from a named range instead of a counted offset, so inserting rows does not break it. Keep HLOOKUP only for older versions or strictly horizontal layouts.