Lookup and Reference Functions: Practical - 6
Lookup and Reference Functions: Practical - 6
INTRODUCTION:
In this report we will be looking at Vlookup and Hlookup functions. The VLOOKUP function
always looks up a value in the leftmost column of a table and returns the corresponding value
from a column to the right. 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. Also we will be looking at Indirect function in
Vlookup, report using Vlookup
ABOUT DATASET:
The data used for this report is an excel sheet with data on the distribution of a certain product
among different consumer segments in different provinces. The data contains details regarding
number of quantity of products sold, its total sales amount and the shipping cost for
transportation of the goods. The dataset contains 858 observations with 11 variables.
OBJECTIVES:
ANALYSIS:
1. VLOOKUP
The VLOOKUP function always looks up a value in the leftmost column of a table and returns
the corresponding value from a column to the right.
Procedure: -
1. Suppose if we want to separate out ship mode then we can use Vlookup.
2. This was used to return Ship Mode of order ID 2277. Here Order ID is the primary key.
2. HLOOKUP
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.
Procedure: -
1. Here the variables are arranged in rows and if we want to extract out product container
then we can use Hlookup function.
2. Suppose if we want to separate out Product container then we can use Hlookup.
3. This was used to return Product Container of order ID 2277. Here Order ID is the
primary key.
Vlookup with indirect function helps in locating the values of a data from beyond the
active excel sheet. Using this function we can get the several values of different
parameters for one particular object from several excel sheets within the book.
For using the vlookup with indirect, we have to arrange different parameters in different
sheets with one column remaining constant while the parameters keep changing. Also
name the sheets on the name of the parameters for convenience.
The constant column should contain the object for which you will locate the different
parameters.
Now, tabulate the different parameters in a table and keep the object for referencing in a
different cell.
Use the syntax for vlookup with indirect function to refer to the different values of parameter
stored in different sheets
Procedure:
Open Excel sheet
Name a column as “2277” and below it type the names of the Excel sheets from
where data needs to be extracted ie, “Sheet8”, “sheet5”, “sheet6” and “sheet7”.
Name another column as “Details”
Now in front of “Ship Mode” type the excel function VLOOKUP as follows:-
=VLOOKUP($N$10,INDIRECT(""&N11&"!A1:B859"),2,0)
Fill up the formula for others as well
CONCLUSION:
We have seen the usage of vlookup, hlookup functions and how they can assist the user in
locating the different values within a data sheet. With the introduction of indirect function the
barrier of locating the functions within the active sheet got removed and we were able to locate
the values of different parameters for a single object from multiple sheets using the combination
of vlookup with indirect function.