Lookup Functions
The Lookup functions are listed under FORMULASINSERT FUNCTION and under FORMULASLOOKUP & REFERENCE option.
The Lookup functions are listed under FORMULASINSERT FUNCTION and under FORMULASLOOKUP & REFERENCE option.
VLOOKUP (Vertical Lookup): Looks for a value in the leftmost column of a table, and then returns a value in the same row from a column you specify. By default the table must be sorted in an ascending order.
Lookup_value: It is the value to be found in the first column of the table, and can be a value, a reference, or a text string.
Table_Array: It is a table of text, numbers, or logical values, in which data is retrieved. Table_array can be a reference to a range or a range name.
Col_Index_num: It is the column number in table_array from which the matching value should be returned. The first column of value in the table is column 1.
Range_Lookup: It is a logical value, to find the closest match in the first column (stored in ascending order) =TRUE or omitted; find an exact match = FALSE.
The above definitions have been sourced from www.Microsoft.com.
For our example below, we are taking two tables; Department and Employee.
Department Table has two columns; Dept No and Dept Name; Col_index_num value of DeptNo is 1. Col_index_num value of Dept Name is 2.
Employee table has 3 columns; First Name, Dept No, Dept Name and Dept Name does't have any values.
Our intention to use VLOOKUP is to take each value in Employee.Deptno and find whether that value is present in Department.DeptNo. if tDepartment.DeptNo value is present, then the corresponding Department.DeptName has to be populated in Employee.DeptName. Now we are examining this data with few records. If there are thousands of records, then it will be difficult for anyone to manually check and populate the data in Employee.DeptName. This can be done easily with VLookup function.