What VLOOKUP does and when to use it
VLOOKUP is a formula that searches for a value in the first column of a table and returns a value from another column in that same row. Use it when you have two related lists of data and need to pull information from one list based on a match in the other.
For example: you have a list of product codes in one column and prices in another. VLOOKUP lets you type a product code and automatically get its price. Or you have employee IDs matched to department names, and you want to look up which department an employee belongs to.
VLOOKUP only searches left to right within a table — it finds a match in the leftmost column and returns data from a column to its right. If you need to search a column on the right and return data from the left, you'll need a different formula like INDEX and MATCH instead.
Key Takeaways
- VLOOKUP requires four pieces of information: the value you're searching for, the table containing your data, which column to return data from (counted from the left), and whether you want an exact match or approximate match.
- The lookup column (the one VLOOKUP searches) must always be the leftmost column in your table range.
- Use FALSE or 0 for exact matches, which is the most common choice; use TRUE or 1 only when your lookup column is sorted in ascending order and you want the closest match below your search value.
- Common errors like #N/A (value not found) and #REF! (broken table reference) usually mean either the value doesn't exist in your lookup column or your table range is wrong.
The basic VLOOKUP syntax and what each part means
The formula structure is: =VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
lookup_value is what you're searching for — usually a cell reference like A2, or a value you type in quotes like "Widget". table_array is the range of cells containing your data, written as StartCell:EndCell (for example, A1:D100). col_index_num is the column number you want to return data from, counted from the left side of your table range — if your table starts at column A, then column A is 1, column B is 2, column C is 3, and so on. range_lookup is either FALSE (or 0) for an exact match, or TRUE (or 1) for an approximate match.
A real example: =VLOOKUP(A2, A:D, 3, FALSE) searches for the value in cell A2 anywhere in columns A through D, and returns the value from the third column of that range (column C). The FALSE means it will only return a result if it finds an exact match.
Step-by-step: setting up your data and writing the formula
Step 1: Arrange your data so the lookup column is on the left. VLOOKUP searches the leftmost column of your table range, so if you need to search by product code, product code must be in the first column. If your data is arranged differently, you'll need to rearrange it or use a different formula.
Step 2: Decide where your formula will go. Usually you put VLOOKUP in a new column next to your data. For example, if you have product codes in column A and prices in column B, you might put your VLOOKUP formula in column C to pull in related information from another table.
Step 3: Click the cell where you want the formula. Type the formula starting with an equals sign. Use cell references for the lookup value (like A2) rather than typing the value itself, so you can copy the formula down to other rows.
Step 4: Use absolute references for your table range. When you write your table_array, put dollar signs around the range: $A$1:$D$100 instead of A1:D100. This keeps the table range fixed when you copy the formula to other cells. The lookup_value (like A2) should not have dollar signs, so it changes to A3, A4, and so on as you copy down.
Step 5: Press Enter and copy the formula down. After you press Enter, click the cell with your formula. Grab the small square at the bottom-right corner of the cell and drag it down to copy the formula to as many rows as you need.
Exact match versus approximate match
The fourth part of VLOOKUP — range_lookup — controls how strictly the formula searches. FALSE or 0 means exact match: the formula returns a result only if it finds the exact value you're looking for. If the value doesn't exist, you get #N/A error. Use this most of the time.
TRUE or 1 means approximate match: if the exact value isn't found, the formula returns the largest value that is smaller than your search value. This only works correctly if your lookup column is sorted in ascending order (A to Z, or smallest to largest number). Approximate match is useful for things like tax brackets or commission rates, where you want "the closest match below this value." If your data isn't sorted, approximate match will give you wrong answers.
When in doubt, use FALSE. It's safer and works with any data arrangement.
Common errors and what they mean
#N/A error means the lookup value was not found in the first column of your table range. Check that the value actually exists in that column — watch for extra spaces, different capitalization, or typos. If you're using FALSE for exact match, even a small difference will cause #N/A.
#REF! error means your table_array reference is broken, usually because you deleted columns or rows that were part of your range. Fix it by clicking the formula cell and retyping the table range, or by using the Name Box to select the correct range.
#VALUE! error usually means you typed something wrong in the formula syntax — a missing comma, a mismatched parenthesis, or a cell reference that doesn't exist. Read through the formula carefully and compare it to the syntax shown earlier.
Wrong answer returned often means you counted the column number incorrectly. Remember: the first column in your table range is column 1, the second is column 2, and so on. If your table is A:D and you want data from column C, that's column 3.
When VLOOKUP won't work and what to use instead
VLOOKUP searches only the leftmost column of your table range. If the column you need to search is to the right of the column you need to return, VLOOKUP can't do it. In that case, use INDEX and MATCH together — MATCH finds the row number of your value, and INDEX returns the data from that row in whichever column you specify.
If you need to search for a value that appears in multiple rows and return all matching results, VLOOKUP returns only the first match. Use FILTER (in newer versions of Excel) or create a more complex formula with SMALL and IF.
If your lookup column contains duplicate values and you need to return data from a specific duplicate, VLOOKUP will always return the first match. Again, INDEX and MATCH give you more control.
Frequently Asked Questions
Can I use VLOOKUP to search across multiple sheets?
Yes. In your table_array, include the sheet name before the range: =VLOOKUP(A2, Sheet2!A:D, 3, FALSE). If the sheet name has spaces, put it in single quotes: Sheet2!'Sales Data'!A:D. The lookup column must still be the leftmost column in that range.
What's the difference between using A:D and A1:D100 for my table range?
A:D includes the entire columns A through D, so it works even if you add more data later. A1:D100 includes only rows 1 through 100, so if you add data in row 101, VLOOKUP won't find it. Using entire columns is simpler but slightly slower on very large spreadsheets; using a specific range is faster but requires you to know your data size in advance.
Why does my VLOOKUP return the same value for every row?
Your lookup_value probably has dollar signs, like $A$2 instead of A$2. Dollar signs before the column letter and row number keep that cell fixed when you copy the formula down. Remove the dollar sign before the column letter so it changes to A3, A4, and so on as you copy.
Can VLOOKUP work with numbers and text mixed together?
VLOOKUP treats numbers and text as different values. If your lookup column contains the number 100 but you search for the text "100", it won't match. Check your data type — use the Data menu to convert text to numbers if needed, or make sure your search value matches the type in your lookup column.