VLOOKUP Function in Excel
Contents
VLOOKUP in Excel
Vlookup (“V” stands for Vertical) is a build in function in Excel. It is used to lookup(find) a particular value in a table array and returns the specific column in a table. The lookup value must be in the first column of the table.
Syntax of Vlookup function
1 |
=VLOOKUP(lookup_value,table_array,column_index_num,[range_lookup]) |
Arguments description
- lookup_value – The value to find for in the first column of the table
- table_array – The range where the lookup value and its corresponding values are located
- column_index_num – The column number in the range that contains the returns value.
- range_lookup – This is the optional argument. Mention TRUE if you want an approximate match or FALSE if you want an exact match of the return value.If this parameter is omitted, TRUE is the default value.
Example 1: Use FALSE for Exact match
Lets lookup the Employee Name,Designation and Salary based on the Employee id in the below Excel
We have a sample of Employee details.Lets search the Employee id #48322 in the table using Vlookup function and get the Employee Name based on column index 2 in the table array.
1 2 3 |
= VLOOKUP(D3,B11:F16,2,FALSE) // Return the Name = VLOOKUP(D3,B11:F16,4,FALSE) // Designation = VLOOKUP(D3,B11:F16,5,FALSE) // Salary |
Lets apply the other Voolkup formula to get the Designation and Salary from the Employee table array.
If the lookup value is not present in the given table array, the Vlookup function will return the #N/A in the cell.
Example 2: Use TRUE for Approximate match
In some cases, we don’t want to search the exact value in the table.We can use TRUE as fourth argument in the Vlookup function to achieve those scenarios. Lets discuss this with some examples.
We can lookup the student marks in the grade table to get the minimum grade using the Vlookup function as below.
1 |
=VLOOKUP(D6,$G$6:$H$8,2,TRUE) // Used TRUE to get the Approximate match |
The marks such as 400,350 & 300 are approximately match with mark 300 in the Grade table. Since we have mentioned range lookup as TRUE in the Vlookup function, It returned Grade C as Minimum Grade for those marks in the Student marks table.
Similarly other mark 290 approximately matched with mark 260 in the Grade table. So Grade C is returned for the student Grace in the Student marks table.