Spreadsheet Practice

How to use HLOOKUP to look up a value in a row in Excel

Formula (Excel and Google Sheets)

=HLOOKUP(J1,B1:G4,2,FALSE)

Use =HLOOKUP(J1,B1:G4,2,FALSE): it searches the top row of the table and returns the value from the row number you give, here row 2.

Result on the example
$56,800 in J2
Works in
Every current version
Google Sheets
Same formula

See it work

The formula is already in J2. Change any input and the result updates, or edit the formula to experiment.

How it works

HLOOKUP is VLOOKUP turned sideways. It looks for Apr in the first row of B1:G4, then goes down to the 2nd row of that table, which is Revenue, and returns 56,800. FALSE asks for an exact match.

=HLOOKUP(J1,B1:G4,2,FALSE)

Result56800

  1. J1"Apr"

    The value in J1.

  2. B1:G44 rows × 6 cols: "Jan", "Feb", "Mar", "Apr", …

    A range: 4 rows × 6 columns.

  3. HLOOKUP(J1,B1:G4,2,FALSE)56800

    HLOOKUP: Horizontal version of VLOOKUP.

    • lookup_valueJ1"Apr"
    • table_arrayB1:G44 rows × 6 cols: "Jan", "Feb", "Mar", "Apr", …
    • row_index_num2
    • range_lookupFALSE

In Google Sheets

The same formula works in Google Sheets: =HLOOKUP(J1,B1:G4,2,FALSE). We ran it in Google Sheets mode on the same data and it returns $56,800.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=XLOOKUP(J1,B1:G1,B2:G2)$56,800XLOOKUP searches rows as well as columns: give it the header row and the row to return. Excel 2021, Microsoft 365 and Google Sheets.
=INDEX(B2:G2,MATCH(J1,B1:G1,0))$56,800Works in every version and keeps working when rows are inserted.

Common mistakes

  • The row number counts from the top of the table, and the header row is row 1. Revenue is 2, not 1.
  • Without FALSE, HLOOKUP does an approximate match and needs the first row sorted.
  • Inserting a row inside the table shifts the row you meant. XLOOKUP and INDEX/MATCH don't have that problem.

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Use HLOOKUP to look up a value in a row

The months run across row 1. In J2, return the revenue for the month in J1.

Questions

How do I choose the row by its label too?

Find the row number with MATCH: =HLOOKUP(J1,B1:G4,MATCH(I2,A1:A4,0),FALSE) returns the row named in I2.

Can HLOOKUP do an approximate match?

Yes, with TRUE and the first row sorted from smallest to largest, for example thresholds across the top of a rate table.

Should I use HLOOKUP or XLOOKUP?

Use XLOOKUP if everyone has Excel 2021 or later. HLOOKUP still works and is fine for simple tables.

Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.