This
blog will explain syntax and usage of VLOOKUP function which is inbuilt
excel function. In college, my seniors, class mates and professors
always stressed and
added importance to VLOOKUP. But, their words fell on deaf ears. Now, I
realize, if I had understood its functionality and usage, my struggle
with “student batch profile” wouldn’t have been a struggle. Instead, it
would have been a cakewalk. One of my current
assignment, made me to learn and use VLOOKUP extensively. Since then, I
have solved most of the complex problem with ease.
The
syntax of VLOOKUP is very easy. Moreover, online resources make it
easier for anybody to understand its intricacies. I, too, will first
explain its syntax and
then, we will dig more with a help of a case. Refer the figure below
As soon as you type =vlookup in any cell of an excel sheet, automatically, excel will guide you with the format. lookup_value is a unique identifier. This value segregates one row from the another. This helps VLOOKUP function to locate a row in table_array. table_array is a range of cells from where you wish to pull your data using Lookup_value. col_index_num is a integer value. The index value "n" helps VLOOKUP to pick up the value from nth column of the selected row (identified with lookup_value). range_lookup can take two values: 0 and 1. 0 for Exact match and 1 for approximate match.
Refer the table below. It has 6 columns: Roll Number, Name, Age, Math and Science. Roll Number is a unique field. It separates one student with other
English teacher created an another table with three columns : Roll Number, Name, English as shown below
In the cell under Name, he wrote =VLOOKUP(A15,A1:F11,2,0).
A15: This is lookup_value, a unique value. In this case, it is the Roll Number.
A1:F11: This is table_array. It contains or covers entire master data i.e. Roll Number, Name, Age, English, Math and Science marks.
2: This is col_index_num. This value guides VLOOKUP to pick up value from 2nd column, after VLOOKUP have found row with unique lookup_value. If you see, Name is the second column in the master table or table_array.
0: This guides VLOOKUP to look for exact match.
Similarly, he wrote =VLOOKUP(A15,A1:F11,4,0) under the cell English. in this case col_index_num value is 4 because English marks are present in the 4th column of the master table or table_array.
For every other cell, he changed the lookup_value and kept other values same as before. After he updated everything, his table transformed to following table.
Happy Learning!!!!!!!!!!!!