Lesson 12. Looking up data: VLOOKUP, XLOOKUP and INDEX + MATCH
Use the Exercises sheet in lesson12.xlsx: a company's directory of phone extensions.
Files: lesson12.xlsx · solutions: lesson12-solutions.xlsx.
In the exercises with a sheet, type the formula in the fx bar and click Check: the sheet works it out the way Excel does, with commas between the arguments (semicolons work too), and also tries it with other data, to see whether it still works when the data changes. In the other exercises, you work in Excel with the lesson's file and type the result here.
At the end of the page you'll find the lesson's Bonus challenge: one more exercise, whose answer isn't in the book. You check it only here.
Exercise 1
Show the answer
=VLOOKUP(G3,A4:D11,3,FALSE) = Shipping (employee ID E06, Garcia).
Exercise 2
Show the answer
With VLOOKUP, #N/A appears: employee ID E09 doesn't exist in the directory. With XLOOKUP: =XLOOKUP(G6,A4:A11,C4:C11,"Not found") = Not found.
Exercise 3
Show the answer
The name is in column B and the employee ID, to its left, in column A: VLOOKUP only searches the first column and only returns data to its right. =INDEX(A4:A11,MATCH(G9,B4:B11,0)) = E03 (or =XLOOKUP(G9,B4:B11,A4:A11) = E03).
Exercise 4
=VLOOKUP("E04",A4:D11,4,FALSE) return on this sheet?Show the answer
118: Davis's extension, the fourth column of the E04 row.
Bonus challenge
The answer isn't in the book: you check it only here.
Show the answer
With =VLOOKUP(C4,Prices!$A$4:$D$13,2,FALSE) in E4, =VLOOKUP(C4,Prices!$A$4:$D$13,4,FALSE) in F4 and =D4*F4 in G4, copied down to row 11, the highest amount is order 1006, from Oak Hill Elementary: 40 college ruled spiral notebooks (P105) at $2.40 each, so $96.00. Order 1002 has the largest quantity (50 pens), but the pens are cheap: it comes to $60.00. Order 1005 has the code P104, which isn't in the price list: with FALSE it shows #N/A in all three columns. Without FALSE, VLOOKUP would quietly take the closest code, P103, and give a wrong price.