Excel VLOOKUP
An EMIS Coordinator’s
Friend
Vlookup, a function in excel, stands for Vertical Lookup. This function allows you to search a specific table of data, look for a match within the table of data and return a value into the cell containing the Vlookup statement. This document provides an example of how to utilize Vlookup to add the student last name into a spreadsheet based upon the student ID number. As long as there is a common field ( a field that matches between the 2 spreadsheets/worksheets), Vlookup can locate & return information from one sheet to the other.
Sample of FN Extract from Source Data:
This file does not have any student names.
Sample of GI Extract from Source Data:
The student names are located in the GI file.
Import the Extract files containing the information you would like to work with
into an Excel Spreadsheet by utilizing the Data > Import > Text > Fixed Width
options. Refer to the help document on text files & Excel, if need be.
In the Example,we are going to add the student last name as contained in the GI
file to the Student’s record in the FN file.
Notice both files are open in Excel. For this example, each worksheet has been
named to help clarify the steps in this help document. You may leave the default
of sheet1, sheet2, etc. The name of the worksheet is irrelevant to the function.
1. Open the worksheet in which you want to add the Student Last Name into.
2. Locate or insert an empty column into this worksheet.
a. I opted to insert a column after the student ID number.
3. Place your cursor in the 1st cell that you would like to add/pull the student
name into.
4. Click on the f* (Funtion) icon.
a. This will open the “Insert Function” Window.
5. Type Vlookup in the Search Box & Click on Vlookup.
The VLookup Function Argument Window will open.
You can move the Window to the side to allow you to view your spreadsheet if
necessary.
6. Make sure your cursor is in the “Lookup_Value” prompt.
7. Click on the cell in Row 1 that contains the field that has a match in the
other spreadsheet.
a. In this instance my key/match/lookup_value is the Student ID
contained in Cell E1.
b. Notice E1 was populated into the Function Argument Lookup_Value
when I clicked in the cell.
Next we have to tell VLookup where to find the Match and where the information
is to pull into F1.
8. Click on the “Table_array” prompt in the Function Argument Window.
9. Click on the worksheet that contains the field to match to the
“lookup_value” and the other information you want to add to the 1st
sheet.
a. I am clicking on my 2nd worksheet named “GI_Extract_File”.
10. Select the range of cells that contain the column of information to
“match” on and include the columns with the information you want to
pull into the 1st sheet.
a. Column E of the 2nd spreadsheet contains the Student ID numbers
where Vlookup needs to locate the value from E1 of the 1st
spreadsheet.
b. It was a coincidence in this example that the student ID numbers are
both in column E.
c. I am selecting Columns E through L are selected and all rows in those
Columns. The entire range in the example is E1:L542.
TIP: To aid is selecting this block of cells, Hold down the Shift Key &
Select E1 – L1; then press the CTRL key and Arrow Down Key.
Important Note: The first column of data selected for the Table_array
must contain the “match” data.
11. Note what column “number” contains the field you want to pull.
a. In this example Column L contains the student last names.
b. This is 8 columns over from the first column in the Table_array.
The block of cells selected will populate the “Table_array” criteria. This range of
cells must be “anchored” (made an absolute value) so the range will not change
when the formula is copied to other cells.
12. Review the “Table_array” range in the Function Argument Window. a. If the Cell range does not contain $ … then you must add them.
13. Insert $ before each Column Reference & before each Row Reference.
a. To “anchor” the range E1:L542 becomes $E$1:$L$542
14. Click in the Col_index_num box in the Function Argument Window and
enter the Column Number in the Table_array that contains the data to
insert into the 1st sheet.
a. This is the Column Number noted in step 11.
15. Click in the Range_lookup box and enter false
a. False tells Vlookup to find an “exact” match to the data in E1 on the
1st worksheet.
b. True attempts to find a “close” match… not ideal for our use.
16. Click on OK to finish the Function Arguments.
Vlookup will search worksheet 2 (GI_Extract_File) Column E for student number
000100592 until it finds an Exact Match.
When an Exact Match is located the value located 8 Columns over from E in
GI_Extract_File will be returned into worksheet 1 which is McNair.
Since you “Anchored” the Table_array, copy the Vlookup Command all the way
down the column in the 1st worksheet to pull the remainng student names.
17. Select the cell that contains the Vlookup Function.
18. Right Click & Select Copy.
19. Click into the empty cell below the cell with the Vlookup Function. 20. Right Click & Select Paste Special. 21. Select Function or f*
If the Menu doesn’t show the icon for Function ( f*), you can utilize the “Paste
Special” menu option
The Function has copied into the next cell & located the next Student Last Name.
Now you can copy the Function all the way down the Column.
22. Double Click on the “handle” located in the lower right corner of the cell.
a. The handle is the little square.
b. This will automatically copy the Vlookup function all the way down
the column.
The value of N/A will be returned in any instance where a match is not found.
Keep in mind that there is a “formula” behind each of the values returned.
Therefore, any sorting or filtering of the data will distort the results after the
Vlookup has been copied.
If you want to keep the Vlookup value in the 1st spreadsheet so you can
manipulate the data at will, Copy & Paste Special > Value.