How to Use HLOOKUP with Structured Reference in Excel

What Is a Structured Reference?

A structured reference is a term that refers to using a table name in an Excel formula in lieu of a usual cell reference. We will consider it an absolute structured reference if the table name that we are using as a reference does not change when we copy the formula to another cell. The default syntax for absolute structured reference is:

Table[[Column_1]:[Column_2]]

For instance, we have selected the output cell H8 and typed the following formula to get the total value of January and February using the SUM function.

=SUM(Sales_3[Jan]:Sales_3[Feb])

The following image indicates the overview of structured references.

What Is Structured Reference?


How to Use HLOOKUP with a Structured Reference in Excel: 5 Suitable Examples


Example 1 – Exact Match with HLOOKUP

Using the chart or table below, we can see how many people have ordered certain foods on a given day over time. Column H lists the total number of items or orders that were canceled on each of those days. We can find out how many fried chickens were sold in that restaurant on August 7th, 2021.

 Use Exact Match with HLOOKUP with Structured Reference in Excel

Steps:

  • Select any cell randomly from the table range.
  • Go to the Table Design tab and type a name in the Table Name field. We named the table Table_Data’. We will use this table name as a reference in the formula.

Rename Data Table

  • Select the output cell C15 and use the following formula.

=HLOOKUP(C14,Table_Data[#All],6,FALSE)

C14 represents the lookup value, and ‘Table_Data [#All]’ illustrates the Table Array. The third argument is the row number, which corresponds to August 7, 2021, in the table. In the 4th argument of the HLOOKUP function, we have defined the range_lookup as FALSE, which means the function will search for the exact match of the lookup item, ‘Chicken’ in the table.

  • Press Enter.

  • The function will return 132. So, a total of 132 pieces of fried chicken were sold on that particular date.

get the output of the formula

Read More: How to Use IF Function and Structured Reference in Excel


Example 2 – Approximate Match with HLOOKUP

By setting the fourth argument to TRUE, the HLOOKUP function can be used with Approximate Match. If our search criteria partially match the desired exact name, the function will return the output cell if the exact data is located.

Use Approximate Match with HLOOKUP Structured Reference in Excel

Steps:

  • Select any cell randomly from the table range.
  • Go to the Table Design tab and type a name in the Table Name field. We named the table ‘Table_Data2’.

  • Select the output cell C15 and use the following formula.

=HLOOKUP(C14,Table_Data2[#All],6,TRUE)

C14 represents the lookup value, and ‘Table_Data2 [#All]’ illustrates the Table Array. By using TRUE in the 4th argument, we’ve just got a match even after we’ve typed the name of a wrong item that is absent from the table. In cell C14, you can now enter additional food names or partially matched names from the table and observe the function’s output.

  • Press Enter.

 Use formula of HLOOKUP with Structured Reference in Excel

  • We got the value of 132.

return the output

Read More: Applications of Absolute Structured References in Excel Table Formulas


Example 3 – HLOOKUP with MATCH Function

If you don’t want to repeatedly define the row number within the HLOOKUP function, but need to change the date or value in cell C13 and obtain an immediate result, you must use the MATCH function to define the row number of the data present in the corresponding cell. Cells C13 and C14 display, respectively, the date and the food item.

Use HLOOKUP with MATCH Function with Structured Reference in Excel

Steps:

  • Go to the Table Design tab and type a name in the Table Name field. We named the table ‘Table_Data3’.

Rename the Data table

  • Select the output cell C15 and use the following formula.

=HLOOKUP(C14,Table_Data3[#All],MATCH(C13,Table_Data3[[#All],[Date]],0),FALSE)

The output will update whenever you change the date or name of the food item in cells C13 and C14.

  • Press Enter.

apply the formula

  • Here’s the result.

How Does the Formula Work?

  • MATCH(C13,Table_Data3[[#All],[Date]],0)

C14 represents the lookup value, and ‘Table_Data3 [#All]’ illustrates the Table Array. Here, the MATCH function defines the row number of the data present in the corresponding cell. This function will produce the position of C13 in the array and return 7.

  • HLOOKUP(C14,Table_Data3[#All],MATCH(C13,Table_Data3[[#All],[Date]],0),FALSE)

Cells C13 and C14 display, respectively, the date and the food item. In the 4th argument of the HLOOKUP function, we have defined the range_lookup as FALSE, which means the function will search for the exact match of the lookup item- ‘Sliders’ in the table and return 26.


Example 4 – HLOOKUP with a Wildcard Character

On 7 August 2021, we want to find out how many orders were placed for a food item that contained the text ‘Lime’.

Use HLOOKUP with Wildcard Character with Structured Reference in Excel

Steps:

  • Go to the Table Design tab and type a name in the Table Name field. We named the table ‘Table_Data4’.

  • Select the output cell C15 and use the following formula.

=HLOOKUP("*"&C14&"*",Table_Data4[#All],6,FALSE)

C14 represents the lookup value, and ‘Table_Data [#All]’ illustrates the Table Array. In the 4th argument of the HLOOKUP function, we have defined the range_lookup as FALSE, which means the function will search for the partial match of the lookup item- ‘Lime’ in the table.

  • Press Enter.

  • Here’s the result.

show the output


Example 5 – Extracting Multiple Values from an Array

We will determine the quantity of limeade sold over a 5-day period starting on August 3, 2021.

Extracting Multiple Values from Array

Steps:

  • Go to the Table Design tab and type a name in the Table Name field. We named the table ‘Table_Data5’.

rename data table

  • Select the output cell C15 and use the following formula.

=HLOOKUP(C13,Table_Data5[#All],{2,3,4,5,6},FALSE)

C13 represents the lookup value, and ‘Table_Data5 [#All]’ illustrates the Table Array. In the 4th argument of the HLOOKUP function, we have defined the range_lookup as FALSE, which means the function will search for the partial match of the lookup item- ‘Limeade’ in the table.

  • Press Enter.

get the array output


Download the Practice Workbook


Related Articles


<< Go Back to Structured Reference | Table Formula | Excel Table | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Saquib Ahmad Shuvo
Saquib Ahmad Shuvo

Saquib Ahmad Bhuiyan, holding a BSc degree in Naval Architecture & Marine Engineering from Bangladesh University of Engineering and Technology, skillfully integrates engineering expertise with a passion for Excel. He provides solutions to complex issues as an Excel & VBA Content Developer for ExcelDemy Forum. He demonstrates an enthusiastic mindset and adeptness in managing critical situations with finesse, showcasing his commitment to excellence. Apart from creating Excel tutorials, he is interested in Data Analysis with MS Excel, Rhinoceros,... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo