In this comprehensive guide, we will explore everything you need to know about the HLOOKUP function in Excel. HLOOKUP, short for Horizontal Lookup, is a powerful formula that allows you to search for a value in the top row of a table and return the corresponding value in the same column from a specified row. This function is particularly useful when you have a large dataset organized in rows and need to extract specific information based on a given value.


The syntax for the HLOOKUP function is as follows:

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

Here’s a breakdown of the arguments:

  1. lookup_value: The value you want to search for in the top row of the table.
  2. table_array: The range of cells containing the table. This includes the top row with the lookup values and the rows with the data you want to retrieve.
  3. row_index_num: The row number in the table_array from which you want to retrieve the value. The first row (the one with the lookup values) is row 1.
  4. [range_lookup] (optional): A logical value (TRUE or FALSE) that specifies whether you want an exact match (FALSE) or an approximate match (TRUE). If omitted, the default value is TRUE.

HLOOKUP Examples

Let’s dive into some examples to better understand how the HLOOKUP function works.

Example 1: Basic HLOOKUP

Suppose you have a table with product information organized in rows, with columns for Product ID, Name, Price, and Stock. You want to find the price of a product with a specific Product ID.

=HLOOKUP(“P123”, A1:D5, 3, FALSE)

In this example, “P123” is the lookup_value, A1:D5 is the table_array, 3 is the row_index_num (Price), and FALSE indicates that we want an exact match.

Example 2: HLOOKUP with Approximate Match

Imagine you have a table with tax brackets organized in rows, with columns for Income Range, Tax Rate, and Deduction. You want to find the tax rate for a specific income amount.

=HLOOKUP(45000, A1:C6, 2, TRUE)

In this example, 45000 is the lookup_value, A1:C6 is the table_array, 2 is the row_index_num (Tax Rate), and TRUE indicates that we want an approximate match.

HLOOKUP Tips & Tricks

Here are some tips and tricks to help you get the most out of the HLOOKUP function:

  1. Make sure the lookup_value is in the top row of the table_array. HLOOKUP searches for the value only in the first row.
  2. When using an approximate match (range_lookup = TRUE), ensure that the top row of the table_array is sorted in ascending order. This is necessary for the function to work correctly.
  3. If you need to search for a value in a column and return a value from a row to the right, consider using the VLOOKUP function instead.
  4. For more advanced and flexible lookup options, consider using the INDEX and MATCH functions together.

Common Mistakes When Using HLOOKUP

Here are some common mistakes users make when using the HLOOKUP function:

  1. Not sorting the top row of the table_array when using an approximate match (range_lookup = TRUE).
  2. Using the wrong row_index_num, which can result in retrieving incorrect data or an error.
  3. Forgetting to specify the range_lookup argument when an exact match is required, causing the function to default to an approximate match.

Why Isn’t My HLOOKUP Working?

If your HLOOKUP function isn’t working as expected, consider the following troubleshooting steps:

  1. Check the syntax of the formula and ensure all arguments are correctly entered.
  2. Verify that the lookup_value is in the top row of the table_array.
  3. Ensure that the top row of the table_array is sorted in ascending order if using an approximate match (range_lookup = TRUE).
  4. Confirm that the row_index_num is correct and within the range of the table_array.
  5. Make sure the range_lookup argument is set to FALSE if you need an exact match.

HLOOKUP: Related Formulae

Here are some related formulae that can be useful when working with HLOOKUP:

  1. VLOOKUP: Similar to HLOOKUP, but searches for a value in a column and returns a value from a specified row.
  2. INDEX: Returns the value of a cell in a specified row and column within a given range.
  3. MATCH: Searches for a value in a specified range and returns the relative position of the value within the range.
  4. LOOKUP: Performs an approximate match lookup in a one-row or one-column range and returns the corresponding value from another one-row or one-column range.
  5. XLOOKUP: A more advanced and flexible lookup function available in newer versions of Excel, which can replace both HLOOKUP and VLOOKUP.

With this comprehensive guide, you should now have a solid understanding of the HLOOKUP function in Excel and be able to use it effectively in your spreadsheets. Happy searching!


Did you find this article useful?

Share it with your friends or colleagues

About Aepoch Advisors

We are a boutique accounting and consulting firm servicing international businesses operating in China. We offers book keeping and business advisory service. We also help our clients select and implement SAAS business applications
Cloud technology significantly reduces cost foreign companies traditionally spent on tax compliance and ERP systems. Our cloud professionals can help with streamlining your management and controling structure, as well as advising you on how to reduce risks and maximize profits with software purposely built for Chinese business. Contact us today to learn more about our services.