VLOOKUP - Quick Reference Card PDF
VLOOKUP - Quick Reference Card PDF
Use VLOOKUP with lists or tables arranged in vertical columns. Your lookup_value MUST be in the first or leftmost column. It doesnt matter physically where the first column starts: it could start in column A, or it could start in column K. Wherever it starts, the lookup_value argument must exist in the first column of the list or table. If your lookup table starts at column R and ends at column T, column R is considered the leftmost column. To find the column that contains the search result (the col_index_num argument), you literally count, starting from the left, or first column. For example, if your search result is in column C, the col_index_num argument would be number 3. If you leave the range_lookup argument off (which is either True or False), the formula defaults to True. Use absolute cell references, or a named range, if you copy the formula down a column.
What to do if your lookup_value is not in the left column If your lookup_value is not in the left column, and its not practical to move the column, you must use another solution, such as INDEX and MATCH. See the links at the top of the page under See also for more information. VLOOKUP Arguments lookup_value What value are you searching for? This is the lookup value. Excel will try to find a match to this value in the leftmost column of the lookup table. table_array Where do you want to search? This is the lookup table. If you plan to copy your VLOOKUP formula, use absolute references to lock the range, or use a named range. col_index_num Which column contains the search result? Count over from the first column to figure out what this number should be, starting with 1. For example, if your lookup table starts in column A, and the search result is in column C, the col_index_num argument would be 3. range_lookup
False=exact match (enter FALSE, or 0) True=approximate match (enter TRUE, or 1). VLOOKUP defaults to True if you omit the argument. If TRUE, sort the leftmost column in ascending (or A through Z) order, or you may get incorrect formula results. If you dont recall the arguments, Excel can help you out.
Tips
Click the Formulas tab on the ribbon, and then click Insert Function. Type VLOOKUP in the Search for a function box, click VLOOKUP in the Select a function list, and then click OK. The Function Arguments dialog box opens, with an explanation for each argument. Or you can use Formula AutoComplete to get help. Just type the equal sign (=) and the first few letters of VLOOKUP. Double-click the function name, and Excel starts the formula for you. A screentip appears, with the name of each argument in its proper order. If youre not sure about an argument, click a link in the screentip to get a Help topic. If Formula AutoComplete does not appear when you type a formula, the feature may have been turned off. To turn it on, click the File tab in Excel, click Options, and then click the Formulas category. Under Working with formulas, select Formula AutoComplete.
Is your lookup_value not in the first column? VLOOKUP wont work. In the first column, are there unnecessary leading or trailing spaces, or extra spaces between words? These can cause errors. Youll also get errors if the first column contains carriage returns, linefeeds, nonbreaking spaces, or other special characters. Before you use VLOOKUP, check your list or table to make sure the formatting is consistent, and to see that there are no obvious errors.
When to use absolute cell references If you copy your VLOOKUP formula down a column, use absolute references (or a named range) to refer to the table_array (lookup table) argument. VLOOKUP Examples
Looking up a page name
This example uses two spreadsheets. The first spreadsheet (Page Views) contains Page IDs, Page Views, and Hit Percentage, and the VLOOKUP formula. The page names that match the Page IDs are on the second spreadsheet (Pages). The lookup_value is cell F3 on the first spreadsheet. Excel will look up whatever is entered into cell F3 in the first column on the Pages spreadsheet, and return the search result (page name) from the second column on the Pages spreadsheet into cell F4 on the first spreadsheet. In the table_array argument, Pages!A2:B39 refers to the Pages spreadsheet (thats why theres an exclamation mark), and the cell range for the table_array or lookup table. In the col_index_num argument, 2 is the number of the column on the Pages spreadsheet, counting from the left that contains the search result. The range_lookup argument is False because an exact match between page ID and page name is required.
Looking up a discount
In this example, the lookup_value is cell F2. Excel will look up whatever is entered into cell F2 by searching for the value in the left column (Quantity). The table_array argument, B3:C7 refers to the lookup table. In the col_index_num argument, 2 is the number of the Discount column, counting from the left: Quantity is 1, and Discount is 2. The range_lookup argument is TRUE because an approximate match is required. You could also omit the range_lookup argument, in which case Excel will assume the value is TRUE.