HLOOKUP function in Excel: Everything you need to know! (2024)

You’ve probably heard of VLOOKUP which is a very popular and powerful formula in Excel. Far less known is the little brother: HLOOKUP. It basically works the same way as VLOOKUP with one difference: Instead of looking up values vertically, HLOOKUP works horizontally.In this article, you learnhow to use HLOOKUP, what to keep in mind, possible error messages and some more advices about HLOOKUP.

Before we start with the HLOOKUP: Do you know XLOOKUP? It’s new in Excel and has some advantages towards HLOOKUP. That said: Let’s get started!

What do I need HLOOKUPfor?

HLOOKUP function in Excel: Everything you need to know! (1)

The description text in Excel summarizes it quite well:

Searches for a value in the top row of a table or an array of values, and then returns a value in the same column from a row you specify in the table or array.

That means you got a table with data and you are searching for an item in the top row. Once you’ve found thevalue, HLOOKUPwill look below withinthe same columnand return a value from another rowbelow.

HLOOKUPworks the same way as the VLOOKUP formulawith the only difference, that the ranges are transposed: Instead of in a column, the HLOOKUPsearches in a row (HLOOKUP = horizontal lookup; VLOOKUP= vertical lookup).

Structure of HLOOKUP

HLOOKUP function in Excel: Everything you need to know! (2)

The HLOOKUPhas four parts, of which threeneed to be defined. The fourth part is usually just “FALSE”, so wecan omit this part for now. Let’s have a look at HLOOKUPstep by step.

  1. The first part contains the lookup value – the value you are searching for.
  2. The second part defines the area you search in. Important: This area must include both rows:
    • The search rowin which you want to find your search value. This must be the toprow.
    • The return value. Please make sure, your search area is large enough.
  3. Now you have to count: Starting from your search row (that means the top row),you count the rows toyour return valuerow.
  4. The fourth part is (for now) always “FALSE”.
HLOOKUP function in Excel: Everything you need to know! (3)

Let’s fill the definitions above with a simplified example. Youwant to search for “ghi” and get the number from row3 returned.

  1. As you search for “ghi” the first part is “ghi”.
  2. A little bit more difficult: The search area. The area must include the search rowand the return row. In our case that’s row1 (the header row) to row3.
  3. In which rowis your return value located? It’s the third row(counting from the search row – the header row). So you just fill in 3.
  4. The fourth part is “FALSE”.

The complete formula might look something like this: =HLOOKUP(“ghi”,1:4,3,FALSE)

Do you want to boost your productivity in Excel?

Get the Professor Excel ribbon!

HLOOKUP function in Excel: Everything you need to know! (4)

Learn more

Download Free Trial

Add more than 120 great features to Excel!

Another example for the HLOOKUP formula

HLOOKUP function in Excel: Everything you need to know! (5)

The imageon the right hand side shows a simple usage of the HLOOKUP.

  1. First part: The lookup value you are searching for. In this case, it refers to cell B5. Cell B5contains the date 04/01/17so that means we are searching for date 4th of January 2017.
  2. Second part: The range, in whichyou wantto search in. In our example, it’s the table on top. Excel searches in the topmost rowof this range. Besides the search row, the rowwith the return value must also be included in this range.
  3. Third part: The number of the row, which you want to getreturned. So once Excel found the date”04/01/17″ in the cells row 1, you have to define, which value you want it to getreturned. In this example, youwant to know if you go running or to the gym, which is written in column 2 or 3 respectively. As row3 is the thirdrow after 1(whichyousearch in), youhave to write “3”. Keep in mind that the search rowis always “1”.
  4. Fourth part: One optional value, which you can always consider to be “FALSE” (it determines if you want to search for the exact value).

The complete formula is =HLOOKUP(B5,1:3,3,FALSE)

One moreexample for the HLOOKUP formula

HLOOKUP function in Excel: Everything you need to know! (6)

In this example we want to get tax rates from the table in the range C2 to H3. We want to search for the country in row 2 and return the tax rate from row 3.

Again, the HLOOKUP has four parts (example for cell D12):

  • What do we search for? In cell D12 we want to get the tax rate for the “UK”. This value is given in cell C12. So the first part is “C12”.
  • Where do we search? We search in row 2. As this range also has to cover the return row (in our case row 3) we could just write the rows 2:3. But in our example, we further specify column C to H, so that this part is “$C$2:$H$3”.
    Please note: The dollar signs fix the range. If we copy and paste the formula, this range won’t change.
  • We want to return in value from the second row (the first row is the search row, row 2). That means the value for the third part of the HLOOKUP formula is “2”.
  • As usual, the last part is “FALSE”.

The complete formula is =HLOOKUP(C12,$C$2:$H$3,2,FALSE)

HLOOKUPerror messages

There are basically three major (alleged) error messages, which actually tell you quite well how to correctyour formula.You should check your formula, if you got one of the followingreturn values:

  • #REF:Usually, your lookup range is not large enough. Make sure, that both your search and return rowsare within this range.
  • #N/A:The value you search for is not available in your data.You could try searching it manually.
  • #NAME: Check, if you misspelled “HLOOKUP”.
  • 0: This is probably not an error message, but could be the real return value. For example, when your return cell is left blank, a “0” will be shown as the return value of theHLOOKUP formula.

If the above hints don’t help or there is another error message (such as “#DIV/0!”), try searching for the value manually. Maybe there is already an error in your data.

Tips & tricks for the HLOOKUP formula

In orderimprove the usage of the HLOOKUP formula, it’srecommended trying the following tips and tricks:

  • In the third part of the formula, you have to determine the search range. Often, you’d copy and paste the formula so that it makes sense (whenever possible) to select whole rowsinstead of only small ranges. That makes the formula more stable.
  • Also keep in mind that HLOOKUPonly returns the first search result. If your search value occurs several times in your data, only its first occurrence will be returned.
  • If you want to search for a combination of different criteria, there is no direct way with the HLOOKUP. One workaround could be by generating a new “primary key”. Therefore, concatenate the different search values in a new (topmost) row.
  • There are usually alternativeways instead of using HLOOKUP. Please takea look at ourarticle about when to use VLOOKUP, SUMIFSor INDEX/MATCH.
HLOOKUP function in Excel: Everything you need to know! (2024)

FAQs

HLOOKUP function in Excel: Everything you need to know!? ›

HLOOKUP in Excel stands for 'Horizontal Lookup'. It is a function that makes Excel search for a certain value in a row (the so called 'table array'), in order to return a value from a different row in the same column.

How to use hlookup in Excel step by step? ›

How to Use HLOOKUP in Excel?
  1. Step 1: Prepare Your Data. ...
  2. Step 2: Open the HLOOKUP Formula. ...
  3. Step 3: Define the Lookup Value. ...
  4. Step 4: Specify the Table Array. ...
  5. Step 5: Enter the Row Index Number. ...
  6. Step 6: Decide on Range Lookup. ...
  7. Step 7: Complete the Formula.
Apr 30, 2024

What is the importance of Hlookup in Excel? ›

Use HLOOKUP when your comparison values are located in a row across the top of a table of data, and you want to look down a specified number of rows. Use VLOOKUP when your comparison values are located in a column to the left of the data you want to find. The H in HLOOKUP stands for "Horizontal."

What is the concept of Hlookup in Excel? ›

What Is VLOOKUP in Excel? VLOOKUP is a powerful function in Excel that searches for a value in the first column of a range (table or array) and returns a corresponding value in the same row from a specified column. The "V" in VLOOKUP stands for "Vertical," indicating that it searches vertically (downward) in a table.

What is the difference between VLOOKUP and Hlookup? ›

Unlike VLOOKUP, which searches vertically down a column, HLOOKUP searches horizontally across a specific row for a matching value. Once it finds the matching value, it retrieves data from a different row in the same column.

What is the correct syntax for Hlookup? ›

HLOOKUP Syntax

The HLOOKUP function has the following syntax, with 3 required arguments, and 1 optional argument: HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])

Does Hlookup slow down Excel? ›

In Office 365 version 1809 and later, Excel's VLOOKUP, HLOOKUP, and MATCH for exact match on unsorted data is much faster than ever before when looking up multiple columns (or rows with HLOOKUP) from the same table range. These lookup functions now create an internal cached index for the column range being searched.

What are the disadvantages of Hlookup? ›

Limitations of the HLOOKUP Function

One limitation is that it can only perform a horizontal lookup. If your data is structured vertically, you will need to use the VLOOKUP function instead. Another limitation is that the HLOOKUP function can only return a value from a row to the right of the first row.

What is the difference between Xlookup and Hlookup? ›

HLOOKUP defaults to an approximate match and needs the lookup row to be sorted ascending. On the flip side, XLOOKUP defaults to an exact match, which is what you'd usually need in most situations. All the other differences we talked about between XLOOKUP and VLOOKUP also apply to HLOOKUP.

What does Hlookup do in sheets? ›

Horizontal lookup. Searches across the first row of a range for a key and returns the value of a specified cell in the column found.

How many lookups are there in Excel? ›

There are two ways to use LOOKUP: Vector form and Array form

Array form: We strongly recommend using VLOOKUP or HLOOKUP instead of the array form.

What is the Hlookup row function? ›

The HLOOKUP function is one of the lookup and reference functions. It is used to perform the horizontal search for a value in the top row of a table or an array and return the value in the same column based on a specified row index number.

What is the purpose of Hlookup in Excel? ›

HLOOKUP stands for Horizontal Lookup and can be used to retrieve information from a table by searching a row for the matching data and outputting from the corresponding column. While VLOOKUP searches for the value in a column, HLOOKUP searches for the value in a row.

Why is hlookup used much less than VLOOKUP? ›

The use of HLookup function is less as compared to VLookup function. The use of VLookup function is more than compared to HLookup function. It is used when data is listed in rows. Whereas it is used when data are listed in columns.

What is more powerful than VLOOKUP? ›

But if your worksheets contain hundreds or thousands of rows, and consequently hundreds or thousands of formulas, MATCH INDEX will work much faster than VLOOKUP because Excel will have to process only the lookup and return columns rather than the entire table array.

How to use hlookup and match together? ›

Excel HLOOKUP and MATCH

The general principle is essentially the same as in case of Vlookup: you use the Match function to get the relative position of the return column, and supply that number to the row_index_num argument of your Hlookup formula.

How do I remove duplicates in Excel? ›

To filter for unique values, click Data > Sort & Filter > Advanced. To remove duplicate values, click Data > Data Tools > Remove Duplicates.

Top Articles
Latest Posts
Article information

Author: Arline Emard IV

Last Updated:

Views: 6709

Rating: 4.1 / 5 (52 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Arline Emard IV

Birthday: 1996-07-10

Address: 8912 Hintz Shore, West Louie, AZ 69363-0747

Phone: +13454700762376

Job: Administration Technician

Hobby: Paintball, Horseback riding, Cycling, Running, Macrame, Playing musical instruments, Soapmaking

Introduction: My name is Arline Emard IV, I am a cheerful, gorgeous, colorful, joyous, excited, super, inquisitive person who loves writing and wants to share my knowledge and understanding with you.