You are on page 1of 6

Excel VLOOKUP example, using an exact match

You have the following table:

Product ID Available Stock Price


2345 500 15
5457 234 28
9823 155 13
1233 122 12
2344 166 24

You've been asked to come up with a way to check the price of a product when a product

Product ID 9823
Price

You write a VLOOKUP function which looks like this:

Product 5457
Price formula =VLOOKUP(B20,$A$6:$C$10,3,0)
Price 28

Try changing the value in the yellow cell to see the price in B22 change
Note what happens if you enter a value in B20 that isn't in the Product ID column above.
oduct when a product ID is typed into a given cell

Product 2345
Price formula 15
Price 15

uct ID column above.


customer customer product City qty
CameroanApplesLondon Cameroan Apples London 20
CameroanBiscuitParis Cameroan Biscuit Paris 30
CameroanBananaKarachi Cameroan Banana Karachi 40
CameroanTeaLahore Cameroan Tea Lahore 50
JerryApplesLondon Jerry Apples London 10
JerryBiscuitParis Jerry Biscuit Paris 15
JerryBananaKarachi Jerry Banana Karachi 12
JerryTeaLahore Jerry Tea Lahore 34
Customer Jerry
product Banana
City Karachi
qty 12
Excel VLOOKUP example, using a nearest match

You have the following table:

Quantity Unit Price


0 20
10 18
50 16
100 13
200 12

You've been asked to come up with a way to check the price of a product for a given sales
The method you use should handle any sales quantity that is entered

You write a VLOOKUP function which looks like this:

Quantity 23
Price formula =VLOOKUP(B18,$A$6:$C$10,2,1)
Price 18

Try changing the value in the yellow cell to see the price in B20 change
Note what happens if you enter a value in B18 that isn't in the Product ID column above.
oduct for a given sales quantity

uct ID column above.

You might also like