Please Note: This article is written for users of the following Microsoft Excel versions: 2007 and 2010. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Understanding the VLOOKUP Function.
by Allen Wyatt
(last updated July 26, 2016)
Excel has a huge number of different worksheet functions—some of them used quite often, and others quite obscure. One of the more obscure functions (at least for Excel novices) is the VLOOKUP function. Understanding how this function works can make your life much simpler, especially when dealing with tables of data and pulling information from those tables.
VLOOKUP is a shortened form of "Vertical Lookup." It is a function that looks vertically (up and down) through a data table and extracts information from the table as you direct. For instance, let's assume you have a data table that lists part numbers and their prices. The part numbers are in column H, and the prices for those parts are in column I. (Assume the data table is in the range H5:I27.) You can use the following formula to look up a part number (located in cell C28) and return its price:
Notice that, at a minimum, VLOOKUP requires three arguments. The first is the value that you want to look up. In this case, C28 contains the part number to be matched in the data table. The second argument is the actual data table, in this case H5:I27. The third argument specifies from which column of the table the value should be returned. In this case I wanted the price, which was in the second column (column I) of the data table.
What VLOOKUP does, in this instance, is to take the value in C28 and then try to match it to a cell in the first column of the range H5:127. If it finds a match, then it returns the value from column 2 of that range—the price we wanted.
VLOOKUP will also accept an optional fourth argument, which can be either TRUE or FALSE. The default value for the argument is TRUE, which means that VLOOKUP will approximate values when matching them in the data table. If an exact match cannot be found in the data table, then VLOOKUP considers the next lowest value in the first column of the table to be a match. Thus, if you are looking for a part number such as "P23," and there is no such part number in the table, but there is a "P22," then VLOOKUP considers that a match. If you set the optional fourth argument to FALSE, then VLOOKUP only returns successfully if it can make an exact match.
Because of the way in which VLOOKUP does its matching, it is very important that the information in your data table be sorted in ascending order according to the values in the first column.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9576) applies to Microsoft Excel 2007 and 2010. You can find a version of this tip for the older menu interface of Excel here: Understanding the VLOOKUP Function.
Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!
When performing a statistical analysis on a large dataset, you may want to use GEOMEAN to figure out the geometric mean ...Discover More
Need to find a median value in a series of values? It's easy with the MEDIAN function. What isn't as easy is to derive ...Discover More
Got a ton of names from which you need to select a few random names? There are several ways you can extract what you ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.