ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before the interview. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Lookups
  3. HLOOKUP in Excel (and When to Use It)

HLOOKUP in Excel (and When to Use It)

By ExcelReady Team·Updated October 30, 2026·7 min read

The short answer

HLOOKUP searches across the top row of a table and returns a value from a row below it: =HLOOKUP(lookup_value, table_array, row_index_num, FALSE). Use it for sideways tables, like a rate card with zones across the top. It is VLOOKUP turned on its side. In Excel 2021 or Microsoft 365, XLOOKUP does the same job more safely.

Key takeaways

  • HLOOKUP searches the first row of a table, then returns a value from the same column, further down.
  • Rows are counted from the top of the table, not from row 1 of the sheet.
  • End with FALSE for an exact match; leaving it out means an approximate match.
  • A row number bigger than the table gives #REF!; a value that isn't in the top row gives #N/A.
  • XLOOKUP and INDEX MATCH can replace HLOOKUP and don't break when rows are inserted.
On this page+
  1. HLOOKUP Excel syntax, part by part
  2. How to use HLOOKUP: a shipping rate card example
  3. HLOOKUP vs VLOOKUP: what's the difference?
  4. Using HLOOKUP with an approximate match
  5. Why does HLOOKUP return #N/A or #REF!?
  6. How to make HLOOKUP survive inserted rows
  7. When to use HLOOKUP (and when not to)
  8. Practise it

HLOOKUP finds a value in the top row of a table and returns something from a row below it. Use the HLOOKUP Excel function when your table runs sideways, with the labels across the top, like a rate card or a price grid. It works in every version of Excel. This guide is for beginners who know a little VLOOKUP, or who met a sideways table in a job test.

HLOOKUP Excel syntax, part by part#

HLOOKUP has four parts, and the last one decides exact or approximate match:

Excel formula
=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
  • lookup_value: what you want to find in the top row, like a zone code.
  • table_array: the whole table, including the top row you search.
  • row_index_num: which row of the table to bring back. Row 1 is the top row of the table.
  • range_lookup: FALSE (or 0) for an exact match. TRUE (or 1), or leaving it out, gives an approximate match.

The "H" stands for horizontal. HLOOKUP is VLOOKUP turned on its side: VLOOKUP searches down the first column and counts columns to the right, while HLOOKUP searches across the first row and counts rows down. If you know one, you know the other. Our VLOOKUP function guide covers the shared ideas in more detail.

How to use HLOOKUP: a shipping rate card example#

Here is a rate card in B1:F4, with zones across the top:

ABCDEF
1ZoneZ1Z2Z3Z4Z5
2Base Fee5.507.259.0011.5014.00
3Per kg0.801.101.451.902.40
4Delivery Days12346

The shipments are listed below: SH-301 is going to zone Z3 (in B7) and weighs 12 kg (in C7). To get its base fee, type this in D7:

Excel formula
=HLOOKUP(B7,$B$1:$F$4,2,FALSE)

HLOOKUP searches the top row for Z3, finds it in column D, then goes down to row 2 of the table and returns 9.00. The $ signs lock the table so it stays in place when you fill the formula down with Ctrl+D (Mac: ⌘D).

Change only the row number to get the other values:

You wantRow numberFormulaResult for Z3
Base fee2=HLOOKUP(B7,$B$1:$F$4,2,FALSE)9.00
Per kg rate3=HLOOKUP(B7,$B$1:$F$4,3,FALSE)1.45
Delivery days4=HLOOKUP(B7,$B$1:$F$4,4,FALSE)3

Because HLOOKUP returns a number, you can use it in a calculation. The shipping cost is the base fee plus the weight times the per-kg rate:

Excel formula
=HLOOKUP(B7,$B$1:$F$4,2,FALSE)+C7*HLOOKUP(B7,$B$1:$F$4,3,FALSE)

For SH-301 that is 9 + 12 × 1.45 = 26.40. Excel multiplies before it adds, so you don't need brackets.

HLOOKUP vs VLOOKUP: what's the difference?#

They are the same function in two directions. Pick the one that matches how your table is laid out.

VLOOKUPHLOOKUP
SearchesDown the first columnAcross the first row
Returns fromA column to the rightA row below
Third argumentcol_index_numrow_index_num
Default matchApproximateApproximate
Works in older ExcelYesYes

Most business data runs down the page, one record per row, so VLOOKUP is far more common. HLOOKUP shows up with rate cards, monthly summaries with months across the top, and tables exported from other tools.

Using HLOOKUP with an approximate match#

With TRUE as the last part, HLOOKUP finds the largest value in the top row that is less than or equal to your number. That is useful for bands that run across a row, such as volume discounts:

ABCDE
1Qty From11050100
2Discount0%5%10%15%

=HLOOKUP(35,$B$1:$E$2,2,TRUE) returns 5%, because 35 falls in the band that starts at 10. The top row must be sorted from smallest to largest, left to right, or the result can be wrong without any error. The VLOOKUP approximate match guide explains this rule in more depth; it applies to HLOOKUP in exactly the same way.

Why does HLOOKUP return #N/A or #REF!?#

Each error points to a different problem:

  • #N/A means the value wasn't found in the top row. Check the spelling, look for extra spaces (TRIM removes them), and make sure numbers aren't stored as text. With TRUE, #N/A also means your number is smaller than the first value.
  • #REF! means the row number is bigger than the table. B1:F4 has 4 rows, so row 5 doesn't exist.
  • A wrong number with no error usually means a missing FALSE, so HLOOKUP did an approximate match on an unsorted row.
  • The table moved. If you forget the $ signs, the table slides down as you fill and loses the top row. The lower rows then show #N/A.

How to make HLOOKUP survive inserted rows#

A typed row number breaks when someone inserts a row inside the table. If a new "Fuel Surcharge" row goes in above Per kg, your 3 now points at the surcharge, and every shipping cost is wrong with no error. You can let MATCH find the row number instead:

Excel formula
=HLOOKUP(B7,$B$1:$F$4,MATCH("Per kg",$A$1:$A$4,0),FALSE)

MATCH looks for the label "Per kg" in the row labels and returns its position, 3. Because the label range starts on row 1, the same row as the table, the position lines up with HLOOKUP's row count. Insert a row, and MATCH finds the new position by itself. The same trick works with VLOOKUP, using MATCH on the header row for the column number.

When to use HLOOKUP (and when not to)#

Use HLOOKUP when the file must work in any version of Excel, or when a test asks for it by name. Otherwise, two newer options are safer, because they don't use a typed row number that breaks when someone inserts a row.

XLOOKUP (Excel 2021 or Microsoft 365) searches a row as easily as a column. Give it the top row to search and the row to return:

Excel formula
=XLOOKUP(B7,$B$1:$F$1,$B$2:$F$2)

It defaults to an exact match, so you can't forget FALSE. Read XLOOKUP in Excel: everything a beginner needs to learn the rest of its options.

INDEX MATCH works in every version. MATCH finds the column of the zone, and INDEX returns that position from the Base Fee row:

Excel formula
=INDEX($B$2:$F$2,MATCH(B7,$B$1:$F$1,0))

See how INDEX MATCH works for a full walk-through. And when you need to match both a row label and a column header, such as a zone and a fee type at once, use a two-way lookup with INDEX and two MATCHes.

Practise it#

Reading about lookups is not the same as typing them. In ExcelReady's HLOOKUP lesson, you work through the shipping rate card from this guide in a live spreadsheet: find base fees, lock the table, return the per-kg rate and delivery days, and build the full shipping cost formula from two HLOOKUPs. Try the plan exercise on this page, then practise HLOOKUP on a sideways rate card.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

The plans run across row 1. Click B7 and use HLOOKUP to return how many users the plan in B6 allows. Search the table B1:D4. Users is row 3 of the table, and you want an exact match.

fx
ABCDE
1
Plan
Basic
Standard
Premium
2
Monthly Fee
9
15
25
3
Users
1
5
20
4
Storage (GB)
10
100
1000
5
6
Plan
Standard
7
Users
8
9
10

Tip: Count rows from the top of the table: the plan names are row 1, Monthly Fee is row 2.

Practise this in a lesson

LessonHLOOKUP for horizontal tablesRead a sideways rate card with HLOOKUP, which searches across the top row instead of down the first column.Function guideVLOOKUPLearn VLOOKUP with clear examples, the 4 most common mistakes, and a live practice exercise you can try in your browser.

Frequently asked questions

What is the difference between VLOOKUP and HLOOKUP?

+

VLOOKUP searches down the first column of a table and returns a value from a column to the right. HLOOKUP searches across the first row and returns a value from a row below. The arguments are the same apart from column number versus row number.

What does the H in HLOOKUP stand for?

+

Horizontal. HLOOKUP looks across a row, while VLOOKUP (vertical) looks down a column.

Why does HLOOKUP return #REF!?

+

The row number is larger than the number of rows in your table. A table like B1:F4 has 4 rows, so asking for row 5 gives #REF!.

Can HLOOKUP look up a value in a row below the table's top row?

+

No. HLOOKUP always searches the first row of the range you give it and can only return values below it. Use INDEX MATCH or XLOOKUP to search any row.

Should I use HLOOKUP or XLOOKUP?

+

Use XLOOKUP if everyone who opens the file has Excel 2021 or Microsoft 365. Use HLOOKUP when the file must work in older versions of Excel, or when a test asks for it by name.

Sources

  • HLOOKUP function - Microsoft Support
  • XLOOKUP function - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. HLOOKUP Excel syntax, part by part
  2. How to use HLOOKUP: a shipping rate card example
  3. HLOOKUP vs VLOOKUP: what's the difference?
  4. Using HLOOKUP with an approximate match
  5. Why does HLOOKUP return #N/A or #REF!?
  6. How to make HLOOKUP survive inserted rows
  7. When to use HLOOKUP (and when not to)
  8. Practise it

Keep reading

Lookups· 6 min read

INDEX MATCH in Excel: The Beginner's Guide

INDEX MATCH is a lookup built from two functions. MATCH finds the position of a value in one column, and INDEX returns the item at that position from another column: =INDEX(A2:A9,MATCH(G2,B2:B9,0)). It can look left, it keeps working when columns are inserted, and it runs in every version of Excel.

Lookups· 6 min read

Two-Way Lookup in Excel (Row and Column)

A two-way lookup finds the value where a row and a column meet, like units sold for one product in one month. Use INDEX with two MATCHes: =INDEX(B2:E6,MATCH(H1,A2:A6,0),MATCH(H2,B1:E1,0)). The first MATCH finds the row, the second finds the column, and INDEX returns the cell where they cross.

Lookups· 7 min read

XLOOKUP in Excel: Everything a Beginner Needs

XLOOKUP finds a value in one range and returns the matching item from another: =XLOOKUP(G2,B2:B9,A2:A9). It defaults to an exact match, can return a column on either side, and has a built-in if_not_found message instead of #N/A. It needs Excel 2021, Excel 2024 or Microsoft 365; it isn't in Excel 2019 or earlier.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free