How to hlookup in excel

Content on WhatAnswers is provided "as is" for informational purposes. While we strive for accuracy, we make no guarantees. Content is AI-assisted and should not be used as professional advice.

Last updated: April 4, 2026

Quick Answer: The HLOOKUP function in Excel searches for a value in the top row of a table or array and returns the value in the same column from a specified row. It's designed for horizontal lookups, contrasting with VLOOKUP's vertical approach.

Key Facts

Overview of HLOOKUP in Excel

The HLOOKUP function in Microsoft Excel is a powerful tool for searching for information horizontally within a dataset. Unlike its more commonly known counterpart, VLOOKUP, which searches vertically, HLOOKUP is specifically designed to find a value in the first row of a table or array and then return a value from a different row in the same column. This makes it incredibly useful when your data is organized with headers or comparison points running across the top rather than down the side.

Imagine you have a table where different months are listed in the first row, and subsequent rows contain sales figures, expenses, or other metrics for each month. If you want to quickly find the sales figure for, say, 'March', you would use HLOOKUP to scan the first row for 'March' and then pull the corresponding sales figure from the correct row below it.

Understanding the HLOOKUP Syntax

The basic syntax for the HLOOKUP function is as follows:

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

How to Use HLOOKUP: Step-by-Step Examples

Example 1: Finding Exact Sales Data

Let's say you have the following data in cells A1:D3:

MonthJanFebMar
Sales150018002200
Target140017002000

If you want to find the 'Sales' figure for 'Mar', you would enter the following formula in any empty cell:

=HLOOKUP("Mar", A1:D3, 2, FALSE)

Here:

This formula would return 2200.

Example 2: Using a Cell Reference for Lookup Value

Instead of typing 'Mar' directly, you can reference a cell. Let's say cell F1 contains the text 'Mar'. The formula becomes:

=HLOOKUP(F1, A1:D3, 2, FALSE)

This will also return 2200.

Example 3: Approximate Match for Ranges

Consider data where the first row represents score ranges and the second row represents the corresponding grade:

Score Range0-5960-7980-100
GradeDCA

If you want to find the grade for a score of 75, you might think HLOOKUP can do this. However, HLOOKUP works best when the lookup_value is in the lookup_value column/row. For this scenario, VLOOKUP or XLOOKUP are typically better suited. But if we adapt the data to make HLOOKUP work:

Lower Bound06080
GradeDCA

To find the grade for a score of 75, using the second table format:

=HLOOKUP(75, A1:D2, 2, TRUE)

Here:

This formula would return C.

When to Use HLOOKUP vs. VLOOKUP

The choice between HLOOKUP and VLOOKUP depends entirely on the orientation of your data:

Limitations and Alternatives

While HLOOKUP is useful, it has limitations:

For these reasons, Microsoft has introduced the XLOOKUP function in newer versions of Excel (Microsoft 365, Excel 2021). XLOOKUP is more versatile, capable of looking up in any direction (left, right, up, or down), and offers more robust error handling and features. It is generally recommended to use XLOOKUP if your version of Excel supports it.

Conclusion

HLOOKUP remains a valuable function for performing horizontal lookups in Excel, especially when dealing with older versions or specific data structures. By understanding its syntax and how to apply it with both exact and approximate matches, you can efficiently retrieve the information you need from your spreadsheets.

Sources

  1. Lookup function - WikipediaCC-BY-SA-4.0
  2. HLOOKUP function - Microsoft Supportfair-use
  3. HLOOKUP Function in Excel - Step by Step Guidefair-use

Missing an answer?

Suggest a question and we'll generate an answer for it.