MS EXCEL 2003
VLOOKUP
A. Background Reading
Notes:
The VLOOKUP function allows you to search for a value in one table and return
a value or label from the table to a cell in the spreadsheet. The VLOOKUP
function could be used to:
• Price items based upon quantity sold
• Convert a student’s percent to a letter grade
• Assign commission rates based upon products sold
• Assign an income tax rate based upon level of income
The value you want to The location of the The number of the
find a match for in the VLOOKUP table you column containing
VLOOKUP table created. Use an absolute the matching value
cell reference for this that you want
location in the function. returned. Usually
this is 2
BTA3O1 Information and Communication Technology: The Digital Environment- Productivity Software
Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 1 of 13
BTA3O1 – Productivity Software – Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 2 of 13
MS EXCEL 2003
VLOOKUP
BTA3O1 Information and Communication Technology: The Digital Environment- Productivity Software
Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 2 of 13
BTA3O1 – Productivity Software – Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 3 of 13
MS EXCEL 2003
VLOOKUP
BTA3O1 Information and Communication Technology: The Digital Environment- Productivity Software
Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 3 of 13
BTA3O1 – Productivity Software – Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 4 of 13
MS EXCEL 2003
VLOOKUP
Exercises —
Ex. 1 A walk-through example
1. Open a new workbook named Excel_vlookup_ex5a.xls with 2 worksheets.
Right-click on the worksheet tabs at the bottom of the Excel screen to
rename Sheet 1 as Data and Sheet 2 as Suppliers.
4. Note that the Supplier ID and Supplier Name fields are repeated in this
sheet. We will enter the Supplier ID only; VLOOKUP will automatically
enter the Supplier Name.
5. Add some sample data.
BTA3O1 Information and Communication Technology: The Digital Environment- Productivity Software
Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 4 of 13
BTA3O1 – Productivity Software – Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 5 of 13
MS EXCEL 2003
VLOOKUP
8. Enter the VLOOKUP function by clicking on the down arrow next to the
AutoSum button ∑ on the Standard toolbar. Select More Functions. The
Insert Function dialog box opens.
BTA3O1 Information and Communication Technology: The Digital Environment- Productivity Software
Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 5 of 13
BTA3O1 – Productivity Software – Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 6 of 13
MS EXCEL 2003
VLOOKUP
13. In the dialogue box labeled Lookup_value enter E2 (that is, the
cell holding the Supplier ID).
Or you can click on the small red arrow, select E2, then press Enter.
Here’s how VLOOKUP will work. It will
i. compare the contents of E2 . . .
ii. with the first column (Supplier ID) of the lookup
table, then . . .
iii. input the Supplier Name that’s paired with the ID
into the current cell (that is, the cell where you’re
putting the function) or F2.
14. Table_array is the lookup table.
i. Click on the red arrow in the bottom corner of the
table_array box
ii. Click on the Suppliers sheet.
iii. Select A2:B7.
BTA3O1 Information and Communication Technology: The Digital Environment- Productivity Software
Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 6 of 13
BTA3O1 – Productivity Software – Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 7 of 13
MS EXCEL 2003
VLOOKUP
BTA3O1 Information and Communication Technology: The Digital Environment- Productivity Software
Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 7 of 13
BTA3O1 – Productivity Software – Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 8 of 13
MS EXCEL 2003
VLOOKUP
First a VLOOKUP table is created using given criteria (see below, A2:B7)
Then the VLOOKUP function is added to the spreadsheet to create the
conversion
A B C D E F
1 VLOOKUP function syntax
VLOOKUP Jane’s created in cells E3:E5
TABLE Marks
2 0 F Percent Letter
Grade
3 50 D 78 B =VLOOKUP(D3, $A$2:$B$7,2)
4 60 C 65 C =VLOOKUP(D4, $A$2:$B$7,2)
5 70 B 92 A+ =VLOOKUP(D5, $A$2:$B$7,2)
6 80 A
7 90 A+
1. Read and review the VLOOKUP function theory on the first page.
2. Open a new worksheet named Excel_vlookup_ex2.xls.
3. Duplicate the spreadsheet cells of A1:D7 as illustrated. Do NOT copy
column F; it is there only to help you.
4. In cell E3, add the VLOOKUP function shown in F3. (You may use the
Paste Function button, or select Insert / Function, or type into the cell,
or type into the formula bar.)
BTA3O1 Information and Communication Technology: The Digital Environment- Productivity Software
Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 8 of 13
BTA3O1 – Productivity Software – Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 9 of 13
MS EXCEL 2003
VLOOKUP
5. Copy the function down to cells E4:E5. Your Column E should look like
the illustration.
6. Save the file.
Ex. 3 Using VLOOKUP to assign a discount for quantity
purchases
For a series of purchases by customers, we want to
enter the number of units sold, and have Excel Requirements for this type of
automatically give us a price per unit. The price Vlookup Table:
will vary according to how many units are sold. • Numbers in first column
We’ll use a quantity discount table and the must be in ascending order
VLOOKUP function. • no duplications.
1. Create the Discount Price Table to be used in the VLOOKUP function (see
illustration).
i. Purchases of 1-49 units have a per unit price of $10.00
ii. At 50-99 units, the price drops to
$9.50.
iii. At 100-199 units the price is
$9.00
iv. Over 200 units the price is $8.50.
2. Save as Excel_vlookup_ex3.xls
3. Create the Sales Summary section below the
Discount Price Table as illustrated.
4. In B9 enter a VLOOKUP function to return the
price to the spreadsheet as follows:
The function will look up the value of 50 from cell A9 in the Discount
Price Table $A$2:$B$5 and return the price of $9.50 from the second
column of the VLOOKUP table to cell B9.
5. Copy the VLOOKUP function from B9 to B10:B18. Since the table reference
in our function is absolute ($A$2:$B$5 ) we can copy the function down
the column.
6. Format the column to show currency and 2 decimals.
7. Enter a formula to calculate Total Sales which is simply Units Sold
times Price.
8. Format the column to show currency and 2 decimals.
9. Print two copies (these two printouts will be useful for study and
review purposes):
i. the selection range of A7:C18 (excluding the VLOOKUP table)
showing values and formatting, centered vertically and horizontally
on the page.
ii. the entire spreadsheet showing formulas, on a single page,
showing gridlines and row & column headings
BTA3O1 Information and Communication Technology: The Digital Environment- Productivity Software
Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 9 of 13
BTA3O1 – Productivity Software – Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 10 of 13
MS EXCEL 2003
VLOOKUP
BTA3O1 Information and Communication Technology: The Digital Environment- Productivity Software
Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 10 of 13
BTA3O1 – Productivity Software – Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 11 of 13
MS EXCEL 2003
VLOOKUP
Ex. 4 Practice
Overview: You have recently been hired by Fast Air Service as Area Sales
Manager for the Southern Ontario region. At the end of the month one of your
jobs is to calculate the salary of your salespeople. Your boss wants you to
do it by creating an Excel template, using the VLOOKUP function, so that you
can quickly calculate your department’s monthly salary at the end of every
month.
Additional Information:
• The monthly salary for each salesperson includes a base salary of
$2,000 plus a commission amount based upon their monthly sales figure.
• Commission rate scale:
Monthly Sales Commission Rate
Less than $5000 0%
$5000 to $7499.99 5%
$7500 to $9999.99 7.5%
$10000 to $14999.99 10%
Greater than $15000 15%
• Sales personnel by area
Sales Representative Area Office
Jonathan Small Mississauga
Ida Fung East York
Yves St. James Toronto
Parminder Singh Scarborough
Donna Cooke Hamilton
Glenn Bracey London
1. Create an Excel template to calculate the monthly salary amounts for each
sales representative in your area. Include in the spreadsheet:
• Main title (e.g. Fast Air Service, Southern Ontario)
• Sub title (Sales Department Monthly Report)
• Column headings of “Sales Representative”, “Area Office”, “Monthly
Sales Amount”, “Base Salary”, “Commission Rate”, “Commission Amount”
and “Total Monthly Salary”
• Use the VLOOKUP function to return the Commission Rate to the
spreadsheet. Create the VLOOKUP table using the Commission rate
scale information above. (Note: Your task is to read the
BTA3O1 Information and Communication Technology: The Digital Environment- Productivity Software
Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 11 of 13
BTA3O1 – Productivity Software – Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 12 of 13
MS EXCEL 2003
VLOOKUP
4. Create a Quarterly Salary Summary for the months of April, May and June.
Use the linking feature you learned earlier. Include in the linked
spreadsheet:
• Main title
• Sub title
• Column headings of
• Sales Representative
• Area Office
• Total Monthly Salary - April
• Total Monthly Salary - May
• Total Monthly Salary - June
5. Save the linked file as Excel5_vlookup_salessummary.xls
BTA3O1 Information and Communication Technology: The Digital Environment- Productivity Software
Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 12 of 13
BTA3O1 – Productivity Software – Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 13 of 13
MS EXCEL 2003
VLOOKUP
Enrichment
The section below is for students who have finished their work before the
rest of the class. It will give you a higher level of expertise with
Microsoft Word 2003.
This material will not appear on tests.
BTA3O1 Information and Communication Technology: The Digital Environment- Productivity Software
Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 13 of 13
BTA3O1 – Productivity Software – Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 14 of 13
MS EXCEL 2003
VLOOKUP
BTA3O1 Information and Communication Technology: The Digital Environment- Productivity Software
Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 14 of 13
BTA3O1 – Productivity Software – Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 15 of 13
MS EXCEL 2003
VLOOKUP
5. Copy down the function in B13 to B14. Do you understand why B14 shows the
name Yukio
Tojo even though 309799001 is not her student number?
(Answer: VLOOKUP worked by looking down column A of the lookup table
until it found a number larger than the given number, 309799001. It
stopped at that position, A5, then moved back up one position to A4 and
returned data from the second column, which you specified in the
function.)
6. Now copy down the function in C13 to C14. Notice whose telephone number
appears in C14.
Can you explain why VLOOKUP returned that telephone number?
The FALSE Parameter — By adding a fourth "parameter" to the VLOOKUP function,
we can avoid the problem of an inaccurate results. The parameter FALSE forces
VLOOKUP to return only exact matches, giving an error message when no exact
match can be found.
7. Click in cell B11.
8. In the formula bar add FALSE to the function as follows:
=VLOOKUP(A11,$A$2:$C$5,2, FALSE) .
9. Press Enter.
10. CopyB11 down to B12:B14.
11. An error message appears in B14. Why is this the result you
want?
12. Click in cell C11.
13. In the formula bar add FALSE to the function as follows:
=VLOOKUP(A11,$A$2:$C$5,3,FALSE).
14. Press Enter.
15. CopyC11downtoC12:C14.
11. An error message appears in C14. Why is this the result you want?
BTA3O1 Information and Communication Technology: The Digital Environment- Productivity Software
Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 15 of 13
BTA3O1 – Productivity Software – Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 16 of 13
MS EXCEL 2003
VLOOKUP
4. Select Data / Sort / Sort by: Name (Col. B) to re-sort the data so that
it is not in order by student number.
5. In B11 enter the VLOOKUP function as earlier, with no FALSE parameter.
6. In C11 enter the VLOOKUP function as earlier, with no FALSE parameter.
7. Copy down B11:C11 to B12:C14.
8. Are the results correct? Can you explain them?
9. In B11 and C11 edit the functions by adding the FALSE parameter.
10. Copy down B11:C11 to B12:C14.
11. Are the results correct now? Can you explain them all, including B14
and C14?
BTA3O1 Information and Communication Technology: The Digital Environment- Productivity Software
Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 16 of 13
BTA3O1 – Productivity Software – Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 17 of 13
MS EXCEL 2003
VLOOKUP
BONUS ASSIGNMENT 1
BTA3O1 Information and Communication Technology: The Digital Environment- Productivity Software
Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 17 of 13
BTA3O1 – Productivity Software – Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 18 of 13
MS EXCEL 2003
VLOOKUP
BONUS ASSIGNMENT 2
BTA3O1 Information and Communication Technology: The Digital Environment- Productivity Software
Unit 2: Spreadsheet – Part 5: The VLOOKUP Function – Page 18 of 13