Hi friends… one of the important features of Excel which every user of Excel is expected to be aware of, is VLOOKUP function. Here I take you through the nuts and bolts of VLOOKUP:
What does VLOOKUP do ? VLOOKUP function looks up (searches) a value in one column and then returns the corresponding value in the same row from another desired column.
It’s similar to searching for the phone number of a person from a phone directory where you would first search for the name of the person and then move across that row towards the phone number column and then take a note of the value found in that phone number column.
Signature of the function:
VLOOKUP(lookup_value, table_array, column_index_num, [table_range])
Explanation of arguments of the function:
lookup_value: This argument indicates WHAT is the value that you want to lookup or search.
table_array: This argument indicates WHERE do you want to lookup or search. This argument is also known as lookup table. The lookup value will be searched ONLY in the FIRST column of the lookup table.
column_index_num: This argument indicates value from WHICH column in the lookup table is to be returned.
table_range: This argument indicates whether the search process need to be exact type or approximate type. 0 (zero) or FALSE indicates exact match, 1 or TRUE indicates approximate match. This argument is optional. Although FALSE is most frequently used, TRUE is the default value for this argument, if nothing is specified.
An example is better than a precept.
So, lets understand the working of VLOOKUP function with a couple of examples using some fictitious data:
Example 1.
Scenario: Here are some customer names with their phone numbers alongside maintained by an analyst. The requirement is that the manager will determine the lucky customer each month by some lucky draw and ask for his/her phone number from the analyst, so that the customer may be contacted on Phone.
Now the analyst do not want to search for the customer in that long list of customer and phone numbers manually as we do in a phone directory. He just wanted to enter the name of the person in the cell beside “Best Employee” (i.e., in G2) so that the phone number of the customer is automatically displayed in the cell beside “Phone Number” (i.e., in G3), as in the below screenshot.
Now, lets write the VLOOKUP formula in cell G3 to return the Phone Number of the Lucky Customer present in cell G2 by looking up or searching for that customer in the lookup table spread across the range – B3:C13.
=VLOOKUP(G2,B6:C16,2,FALSE)
Explanation:
WHAT to search: cell G2 has the name of the customer that you want to search.
WHERE to search: the first column in the range B3:C13 is the place where the customer name is to be searched.
value of WHICH column of the range in the corresponding row to return: proceeding from left to right in the range and numbering the columns starting from number 1, in mind, Phone Number column gets number 2. since we want the value from Phone Number column to be returned finally, we specify its enumerator, i.e., 2 here.
Last argument indicating Match Type: Since, we want search for the exact name of the customer in cell G2 from the first column of the lookup table, we will indicate 0 or FALSE here.
Now when you press enter after entering the formula in cell G3, it initially returns a “#NA” since we haven’t yet entered any Lucky Customer name in cell G2.
Testing:
Now lets test our VLOOKUP formula by entering a name of a customer as Lucky Customer in cell G2 to see if it returns the correct phone number of that customer.
I entered “Rathod” as Luck Customer and it correctly returned the respective Phone Number as highlighted the record of this customer in the lookup table in yellow:
* Remember that VLOOKUP does case insensitive search. Hence, in the above example, if you have entered “rathod” in the place of “Rathod”, you would still see the right value being returned.
Caveats: If the column in the lookup table where the lookup value to be searched is not the first column of the lookup table, VLOOKUP wouldn’t work.
Hope you enjoyed reading this post..!! Want to learn more variations of VLOOKUP addressing more challenging business data analysis problems …..? Follow my blog by just entering your email id and hit on follow button at the top right of this blog post..