How to Use the VLOOKUP Function in Excel
How to Use the VLOOKUP Function in Excel GA S REGULAR Menu Lifewire Tech for Humans Newsletter! Search Close GO Software & Apps > MS Office
This is a simple example of the VLOOKUP function where we need to find how many lemons we have in stock from a list of several items. The range we're looking through is A2:B5 and the number we need to pull is in column 2 since "In Stock" is the second column from our range. The result here is 22.
=VLOOKUP(A9,A2:D7,2)
Here are two examples where we write the VLOOKUP function a little differently. They're both using similar data sets but since we're pulling information from two separate columns, 3 and 2, we make that distinction at the end of the formula—the first one grabs the position of the person in A8 (Finley) while the second formula returns the name that matches the employee number in A9 (819868). Since the formulas are referencing cells and not a specific text string, we can leave out the quotes.
VLOOKUP can also be combined with other Excel functions and use data from other sheets. We're doing both in this example to determine whether we need to order more of the item in Column A. We use the IF function so that if the value in position 2 in Sheet4!A2:B5 is greater than 10, we write No to indicate that we don't need to order more.
In this final example, we're using VLOOKUP to locate the discount percentage that should be used for various bulk orders of shoes. The discount we're searching for is in Column D, the range that includes the discount information is A2:B6, and within that range is column 2 that contains the discount. Since VLOOKUP doesn't need to find an exact match, approximate_match is left blank to indicate TRUE. If an exact match isn't found, the function uses the next smaller amount. You can see that in the first example of 60 orders, the discount isn't found in the table to the left, so the next smaller amount of 50 is used, which is a 75% discount. Column F is the final price when the discount is figured in.
How to Use the VLOOKUP Function in Excel
Data retrieval made simple
By Tim Fisher Tim Fisher Senior Vice President & Group General Manager, Tech & Sustainability Emporia State University Tim Fisher has more than 30 years' of professional technology experience. He's been writing about tech for more than two decades and serves as the VP and General Manager of Lifewire. lifewire's editorial guidelines Updated on January 5, 2021 Reviewed by Jessica Kormos Reviewed by Jessica Kormos Saint Mary-of-the-Woods College Jessica Kormos is a writer and editor with 15 years' experience writing articles, copy, and UX content for Tecca.com, Rosenfeld Media, and many others. lifewire's editorial guidelines Tweet Share Email Tweet Share Email MS Office Excel Word Powerpoint Outlook The VLOOKUP function in Excel is used to find a value in a spreadsheet. The syntax and arguments are =VLOOKUP(search_value, lookup_table, column_number, [approximate_match] ) This article explains how to use the VLOOKUP function in all versions of Excel, including Excel 2019 and Microsoft 365.What is the VLOOKUP Function
The VLOOKUP function in Excel is used to find something in a table. If you have rows of data organized by column headings, VLOOKUP can be used to locate a value using the column. When you do a VLOOKUP, you're telling Excel to first locate the row that contains the data you want to retrieve, and then to return the value that's located in a specific column within that row.VLOOKUP Function Syntax & Arguments
There are four possible parts of this function: =VLOOKUP(search_value, lookup_table, column_number, [approximate_match] ) search_value is the value you're searching for. It must be in the first column of lookup_table.lookup_table is the range you're searching within. This includes search_value.column_number is the number that represents how many columns into lookup_table, from the left, should be the column that VLOOKUP returns the value from.approximate_match is optional and can be either TRUE or FALSE. It determines whether to find an exact match or an approximate match. When omitted, the default is TRUE, meaning it will find an approximate match.VLOOKUP Function Examples
Here are some examples showing the VLOOKUP function in action:Find The Value Next to a Word From a Table
=VLOOKUP("Lemons",A2:B5,2)This is a simple example of the VLOOKUP function where we need to find how many lemons we have in stock from a list of several items. The range we're looking through is A2:B5 and the number we need to pull is in column 2 since "In Stock" is the second column from our range. The result here is 22.
Find an Employee' s Number Using Their Name
=VLOOKUP(A8,B2:D7,3)=VLOOKUP(A9,A2:D7,2)
Here are two examples where we write the VLOOKUP function a little differently. They're both using similar data sets but since we're pulling information from two separate columns, 3 and 2, we make that distinction at the end of the formula—the first one grabs the position of the person in A8 (Finley) while the second formula returns the name that matches the employee number in A9 (819868). Since the formulas are referencing cells and not a specific text string, we can leave out the quotes.
Use an IF Statement With VLOOKUP
=IF(VLOOKUP(A2,Sheet4!A2:B5,2)>10,"No","Yes")VLOOKUP can also be combined with other Excel functions and use data from other sheets. We're doing both in this example to determine whether we need to order more of the item in Column A. We use the IF function so that if the value in position 2 in Sheet4!A2:B5 is greater than 10, we write No to indicate that we don't need to order more.
Find The Closest Number In a Table
=VLOOKUP(D2,$A$2:$B$6,2)In this final example, we're using VLOOKUP to locate the discount percentage that should be used for various bulk orders of shoes. The discount we're searching for is in Column D, the range that includes the discount information is A2:B6, and within that range is column 2 that contains the discount. Since VLOOKUP doesn't need to find an exact match, approximate_match is left blank to indicate TRUE. If an exact match isn't found, the function uses the next smaller amount. You can see that in the first example of 60 orders, the discount isn't found in the table to the left, so the next smaller amount of 50 is used, which is a 75% discount. Column F is the final price when the discount is figured in.