Formulae The VLOOKUP
Formulae The VLOOKUP
When you have a table with data, and you wish to retrieve specific information from it.
Actually whenever you are looking up a name in a phone book, you are performing a “real”
vlookup action: you look up the name of your recipient on the first (most left) column, and when
finding it, you retrieve the number appearing next to that name.
Check the video links above to learn how exactly the vlookup function is written and
implemented inside the worksheet.
If you wish to retrieve Dan's January sales (cell B3), the vlookup function will be:
Let's go over the different parts of the function in plain English (note the highlighted parts in the
following sentence, taken out directly from the formula):
The function will look for the word "Dan" at the first (left) column of the range a2:c4. It will
retrieve the value adjacent to it on the 2nd column (thus the "January" column).
The word "False" tells the function to find Exactly the word "Dan", and not something close or
similar to it.
A way to make the function more readable is to name the table, and use this name in the
vlookup function:
Select the table (no need to include the headers row), and write a name inside the name box
(its located at the top left of the screen). In our vlookup example, we used the name
"salesTable" (Try to avoid using spaces).
=vlookup("Dan",salesTable,2,false).
And if you don't want to retrieve always Dan's January sales, but to retrieve the name that will
be written in cell A6?
=vlookup(A6,salesTable,2,false)
And if you wish the function to retrieve February's sales (instead of January)?
=vlookup(A6,salesTable,3,false)
When you use the Vlookup Excel function to retrieve information based on a student name or a
bank account number, you cannot allow it to find something close or similar to “Jake”, or close
to the account number “3647463”, but rather it has to find them exactly.
But sometimes you have a table that defines ranges, for example:
$5,000 – “Small deposit”
$20,000 – “Medium deposit”
$100,000 – “Big deposit”
$500,000 – “Huge deposit”
If you want the Vlookup to find the description for a deposit of $23,000 (which should retrieve
“Medium deposit”), you will ask it to find a close match, and it will find $20,000.
This is very useful when dealing with dates. Look at the following table:
4/1/2008 – Payment on time.
6/1/2008 – Late with payment (small fine).
8/1/2008 – Very late with payment (big fine).
If you would like to find what happens with a payment made on 7/14/2008, the function will
relate it to the date 6/1/2008 and retrieve us “Late with payment (small fine)”.