The VLOOKUP function in Excel provides some advanced functionality that allows the user to combine information from one file, table or sheet into another file, table or sheet.
It is a relatively simple formula to use but it does have some elements that required understanding before it can be used with confidence.
A common scenario where Vlookup is often used is one where information relating to a specific product, person, or maybe an activity exists in two places and needs to be combined.
In this example, I'm going to use a pre-existing table to provide the values I'd like to 'lookup'.
And then I'm going to create a VLOOKUP function that returns the height of the person when supplied with one of the 3 names in cell F3
You can see there are 3 mandatory arguments and an additional optional argument.
The first argument, lookup_value, is the information that will be used to identify the associated match in the existing table, in this instance this will be the name which will be entered in cell F3. You can see this is highlighted when entered into the formula
The second argument, table_array, is usually a range that defines the boundaries of the existing information that will provide the value returned by the function. In this example it is b2:c5. The column on the left (column B) contains the names which will provide the link between the formula and the result and the column C contains the value that will be returned to the formula.
The third argument, col_index_num, is a whole number which identifies the number of columns to the right of the existing table that we would like to return to the formula. In this instance, the 'Height' is the second column of the existing table so the number entered is '2'.
The fourth and last argument, [range_lookup], is optional but can have an effect on the result of the formula. I would advise that this argument is always set to FALSE until you're more familiar with the formula and have some advanced needs. By setting this argument to FALSE you are ensuring that the Vlookup will always provide an exact match.
Once this is added, the formula is completed. Pressing Enter on the current formula will result in an error as there is no value being provided to the function as the cell F3 is blank. This error is normal and expected.
When the contents of cell F3 is changed to something that exists in the existing table, i.e. one of the names in the cells B3, B4 or B5, the Vlookup formula will provide the associated height of the person. You can see from this example when the name Rod is entered into cell F3.
When the value in cell F3 is changed to Jane, the result of the VLOOKUP function automatically changes to the height associated with Jane, i.e.
Comments
Post a Comment