The core idea of VLOOKUP
is to look up information in a spreadsheet table and place it in another.
For example, suppose this is the table in Sheet1:
John 12/25/1990
Jane 1/1/2000
In Sheet2, place John
, Andy
, and Jane
in A1, A2, and A3.
In B1, to the right of John
, I placed:
=VLOOKUP(A1,Sheet1!$A$1:$B$4,2,FALSE)
Here's a brief explanation of the parameters given to VLOOKUP. The A1 means I'm seeking John
in A1 of Sheet2. The
Sheet1!$A$1:$B$4
tells the function to look at Sheet1, columns A through B (and rows 1 through 4). The dollar signs are necessary to tell Excel to use absolute (rather than relative) references. (Relative references would make the whole thing shift in undesirable ways when copying the formula down.
The 2
means to return the second column, which is the date.
The FALSE
means that you are requiring an exact match.
I then copied down B1 to B2 and B3. (The easiest way to do this would be to click on B1 to highlight it. Then hold the shift key down and press the down arrow twice. Now B1, B2, and B3 are highlighted. Then press Ctrl-D to Fill Down the formula. If done correctly, one should have the same formula in B3 as in B1. If the formulas for the lookup table are changing, for instance from Sheet1!A1:B3
to Sheet1:A3:B5
, then you should use absolute references (with dollar signs) to prevent the change.)
Here are the results:
John 12/25/1990
Andy #N/A
Jane 1/1/2000
It found John and Jane, and returned their birthdates. It did not find Andy, and so it displays an #N/A
.