What VLOOKUP Does and Why People Use It
This free educational guide explains how VLOOKUP works in Microsoft Excel. VLOOKUP stands for "vertical lookup." It searches for a value in the first column of a table and returns a related value from another column in the same row. People often use it to match product codes to prices, employee IDs to names, or student numbers to test scores.
Free Guide to Finding Reset This PC in Windows →
Excel worksheets are large. Since Excel 2007, a single worksheet can hold 1,048,576 rows and 16,384 columns. Scrolling through that much data to find one number is slow and error-prone. A lookup formula lets Excel do the searching for you. You give it a value to find, a table to search, and the column to read from. Excel then returns the answer in the cell where you typed the formula.
VLOOKUP has been part of Excel for many years, so it appears in older workbooks, training courses, and company spreadsheets. Even though newer functions now exist, understanding VLOOKUP helps you read existing files and build reliable lookups of your own.
Key points to remember from this section:
- VLOOKUP searches vertically, meaning down a column.
- It looks for a match in the leftmost column of the table you select.
- It returns a value from a column you choose, in the same row as the match.
Practical takeaway: Before writing any lookup formula, ask yourself two questions. What value am I trying to find? Which column holds the answer I want? Clear answers to these questions make the formula much easier to build.
The Four Parts of the VLOOKUP Formula
Every VLOOKUP formula has the same structure:
Learn About Managing Stomach Cramps at Home →
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
Each part has a specific job. Understanding them one at a time makes the whole formula clearer.
- lookup_value: The item you want to find. This can be a number, a word, or a cell reference such as D2. Using a cell reference is common because you can change the value without rewriting the formula.
- table_array: The range of cells that contains your data, such as A2:C6. The first column of this range must contain the values you are searching through.
- col_index_num: The column number within the table, counted from the left. If the table is A through C, column 1 is A, column 2 is B, and column 3 is C.
- range_lookup: This optional setting tells Excel how strict to be. Type FALSE for an exact match or TRUE for an approximate match. Details appear in the next section.
A common mistake is counting the column index from the worksheet's column letters instead of from the start of the table. If your table begins in column B, then column B is index 1, column C is index 2, and column D is index 3. Always count from the first column of the selected table.
Practical takeaway: Write the four parts on paper before typing the formula. Label each part and check that the column number matches the table you selected, not the column letter on the worksheet.
Exact Match vs. Approximate Match
The last argument in VLOOKUP controls how Excel compares values. This choice has a large effect on your results, so it deserves careful attention.
Your Free Guide to Winning Tennis Matches Smarter →
Exact match (FALSE): Excel returns a result only when it finds an identical value. If no identical value exists, it returns the #N/A error. Exact match is the right choice for most everyday tasks, such as looking up an invoice number or a product code.
Approximate match (TRUE or left blank): Excel finds the largest value that is less than or equal to the lookup value. This method only works correctly when the first column is sorted in ascending order. It is often used for tax brackets, shipping weight tiers, or grade cutoffs.
Here is a real example. Suppose a shipping table lists minimum weights of 0, 5, 10, and 20 pounds, with costs of 4.00, 7.50, 12.00, and 18.00 dollars. A package weighing 12 pounds would match the row starting at 10, so the result would be 12.00 dollars. Approximate match handles this correctly because the weight ranges are sorted.
Now consider what happens when you use approximate match on unsorted data. Excel may return a wrong answer without showing any error. This is one of the most common hidden problems in VLOOKUP.
- Use FALSE when you need one specific, exact item.
- Use TRUE only when the first column is sorted from smallest to largest.
- Check results carefully whenever you switch between the two modes.
Practical takeaway: When in doubt, type FALSE. Exact match is safer for most tasks because it returns an error when something is missing, rather than quietly returning a wrong number.
A Step-by-Step Worked Example
Reading about a formula is different from using one. This example shows a product price list in Excel. Suppose the following data is in cells A1 through C6:
Free Guide to Discount Tire Services and Options →
- Row 1 headers: Product Code, Product Name, Price
- P101, Notebook, 4.50
- P102, Pen, 1.25
- P103, Stapler, 8.75
- P104, Desk Lamp, 22.00
- P105, Calculator, 14.99
Follow these steps to look up a price:
- Step 1: In cell E1, type "Code to Find" as a label. In cell E2, type P103.
- Step 2: In cell F2, type the formula: =VLOOKUP(E2,$A$2:$C$6,3,FALSE)
- Step 3: Press Enter. Cell F2 displays 8.75.
- Step 4: Change E2 to P104. The result updates to 22.00 automatically.
Notice the dollar signs in $A$2:$C$6. These mark the table as an absolute reference, which means it stays fixed when you copy the formula to other cells. Pressing F4 while selecting a range adds these symbols quickly in Excel.
The column number 3 points to column C, which holds the price. If you changed it to 2, the formula would return the product name, Stapler, instead.
Practical takeaway: Build a small test table first. Practice with five or six rows so you can see exactly how each part of the formula changes the result before you use it on a large workbook.
Common Errors and What They Mean
VLOOKUP errors are not random. Each error code points to a specific problem. Learning these codes can save a lot of time when a formula does not work as expected.
Learn How USAA Credit Cards Work →
- #N/A: Excel did not find the lookup value in the first column. Common causes include a typing mistake, extra spaces, or a number stored as text.
- #REF!: The column index number is larger than the number of columns in the table array.
- #VALUE!: The column index number is less than 1.
- #NAME?: Excel does not recognize the function name, often because of a spelling error.
- Wrong result with no error: This often happens with approximate match on unsorted data, or when the table range is too short to include the answer.
Hidden spaces cause many #N/A errors. A code like "P103 " with a trailing space does not match "P103" in Excel. The TRIM function removes extra spaces, so you can use =TRIM(A2) to clean the data before a lookup. Similarly, a number formatted as text, such as '1001 stored as text, will not match a true number 1001.
Excel also does not distinguish between uppercase and lowercase letters in lookups. "p103" and "P103" count as a match. This is helpful, but it can surprise people who expect case-sensitive behavior.
If you expect some values to be missing, you can wrap the formula in IFERROR. For example, =IFERROR(VLOOKUP(E2,$A$2:$C$6,3,FALSE),"Not found") displays a clear message instead of an error code. Use this carefully, because it can hide real problems in your data.
Practical takeaway: When a formula fails, check three things first: spelling and spaces in the lookup value, whether the column index is within the table, and whether the match type is correct.
Alternatives and Next Steps for Learning
VLOOKUP has some limits. Its biggest limit is that it can only look to the right. The lookup column must be the leftmost column of the table. If the value you need sits to the left of the lookup column, VLOOKUP cannot read it directly. Inserting a column also changes the column index number, which can break formulas in shared workbooks.
Free Guide to Finding Reset This PC in Windows →
Excel offers other options for these situations:
- INDEX and MATCH: This pair works in every version of Excel. For example, =INDEX(C2:C6,MATCH("P103",A2:A6,0)) returns 8.75. MATCH finds the row, and INDEX returns the value from the matching row in column C. It can search in any direction.
- XLOOKUP: Available in Microsoft 365 and Excel 2021 and later versions, XLOOKUP searches any column and can return a custom message when no match exists. Its syntax is =XLOOKUP(E2,A2:A6,C2:C6,"Not found").
Choosing among these tools depends on your version of Excel and the layout of your data. If you share a workbook with someone who uses an older version, VLOOKUP or INDEX and MATCH may be the better choice, since XLOOKUP will not work for them.
Learning resources are also widely available. Microsoft's official Excel support pages explain each function with examples. Many libraries and community colleges offer free spreadsheet courses. Practicing on sample data is one of the most effective ways to build skill.
Practical takeaway: Start with VLOOKUP so you understand the logic of lookups. Once you are comfortable, try rebuilding the same lookup with INDEX and MATCH. Comparing the two methods will deepen your understanding of how Excel finds and returns data.