VLOOKUP is Excel's most widely used function for pulling matching data from a table—like finding a product price from a list or retrieving a student's grade from a roster. It works by searching for a value in the first column of a range and returning a corresponding value from another column. No special tools are required beyond Excel itself (any modern version, including Microsoft 365, Excel 2016–2021, or Excel for the web).
What You'll Need
- Microsoft Excel installed (desktop) or access to Excel for the web via a Microsoft account
- A basic dataset with at least two columns: one for lookup values (e.g., IDs, names) and another for return values (e.g., prices, departments)
- No prior Excel expertise needed—just familiarity with typing formulas and selecting cells
Step-by-Step
- Prepare your data: Organize your table so the lookup column (the one containing the value you’ll search for) is always in the leftmost position of your range. For example, if you want to look up employee IDs in column A to return their names from column B, ensure IDs are in A2:A100 and names in B2:B100. Avoid merged cells, blank rows, or leading/trailing spaces in the lookup column, as these break VLOOKUP.
- Identify the four arguments: VLOOKUP requires exactly four inputs in this order:
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]). Break it down:- lookup_value: The cell containing the value you’re searching for (e.g., A2 for employee ID 1001)
- table_array: The full range containing both lookup and return columns (e.g., $A$2:$B$100—use $ to lock the range so it won’t shift when copied)
- col_index_num: The column number within the table_array where the return value lives (1 = first column, 2 = second, etc.)
- range_lookup: Set to FALSE for exact matches (almost always correct); TRUE or omitted uses approximate match (rarely needed)
- Type the formula: In the cell where you want the result (e.g., D2), start with
=VLOOKUP(A2,$A$2:$B$100,2,FALSE). This says: “Look up A2 in the range A2:B100, find the matching row, and return the value from the 2nd column in that range (column B), requiring an exact match.” Press Enter. - Copy and paste the formula: After confirming the first result is correct, click the small square at the bottom-right corner of the cell (the fill handle) and drag down to apply the formula to other rows. Alternatively, copy the cell and paste it into the range below—Excel automatically adjusts the lookup_value (e.g., A2 becomes A3), but your $-locked table_array stays fixed.
- Verify the match: If the result is #N/A, it means no exact match was found. Double-check that the lookup value exists in the first column of your table_array, and ensure formatting matches (e.g., text vs. numbers, spaces). Use
=TRIM(A2)to clean spaces and=VALUE(A2)to convert text numbers to real numbers if needed.
Common Mistakes
- Lookup column not first: VLOOKUP only searches the first column of the table_array. If your ID column is B but you set table_array to B:C, it won’t work—you must include column A as well (e.g., A:C) or reorder your data.
- Missing dollar signs in table_array: Without $ (e.g., A2:B100 instead of $A$2:$B$100), dragging the formula shifts the range incorrectly, causing #REF! or wrong results.
- Wrong col_index_num: Counting from the start of the table_array, not the worksheet column. In $A$2:$C$100, col_index_num 3 refers to column C, not column 3 of the sheet.
- Accidental approximate match: Omitting FALSE (e.g.,
=VLOOKUP(A2,$A$2:$B$100,2)) tells Excel to find an approximate match, which fails unless your data is sorted ascending. Always include FALSE unless you specifically need sorting behavior. - Hidden spaces or nonprinting characters: IDs like “1001 ” (with a space) won’t match “1001”. Use
=EXACT(A2,B2)to test for matches or=CLEAN(TRIM(A2))to preprocess data.
Tips
- Use structured references with Excel Tables: Convert your data range to a table (Ctrl+T), then write
=VLOOKUP([@[Employee ID]],tblData,2,FALSE). This auto-adjusts ranges and avoids $-locking errors. - Wrap in IFERROR for cleaner output: Use
=IFERROR(VLOOKUP(A2,$A$2:$B$100,2,FALSE),"Not found")to return a helpful message instead of #N/A. - Lock the range once: After typing the formula, press F4 to cycle through reference types (e.g., A2 → $A$2 → A$2 → $A2). For table_array, $A$2:$B$100 is safest.
- Test with a small dataset first: Use 3–5 rows to verify your logic before scaling to hundreds of rows.
- Check data types visually: Numbers align right in cells; text aligns left. If IDs look numeric but are stored as text (e.g., “00123”), VLOOKUP fails. Convert using the Error Checker (green triangle) or Text to Columns.
Troubleshooting
When VLOOKUP returns #N/A, #REF!, or #VALUE!, follow this checklist:
- Confirm exact match: Verify the lookup value exists in the first column. Try
=MATCH(A2,$A$2:$A$100,0)instead of VLOOKUP—if it returns #N/A, the value isn’t found. - Inspect data for inconsistencies:
- Use
=LEN(A2)to check for extra characters (e.g., spaces, line breaks) - Apply
=CODE(LEFT(A2))to detect nonprinting characters (ASCII codes above 32 indicate issues) - Re-enter the lookup value manually in a helper column to bypass hidden formatting
- Use
- Check for mixed data types: If your lookup column contains both text and numbers (e.g., “1001” and 1001), convert all to text with
=TEXT(A2,"0")or all to numbers with=VALUE(A2). - Validate table_array boundaries: Ensure the range includes all rows with data. If row 50 is missing, add it: =VLOOKUP(A2,$A$2:$B$100,2,FALSE) → update to $A$2:$B$105.
- Test col_index_num: If you get #VALUE!, your col_index_num is less than 1. If you get a result from the wrong column, recount from the first column in table_array.
- Restart Excel: Rarely, Excel’s calculation engine locks up. Close and reopen the file—this fixes #NAME? errors from corrupted formula parsing.
Frequently Asked Questions
Does VLOOKUP work across different sheets?
Yes. Reference the other sheet in the table_array, like=VLOOKUP(A2,Sheet2!$A$2:$B$100,2,FALSE). For the entire workbook, use =VLOOKUP(A2,'[Data.xlsx]Sheet1'!$A:$B,2,FALSE) (note single quotes around filenames with spaces).
Can VLOOKUP search from right to left?
No—VLOOKUP only searches left-to-right because it must use the first column of the table_array for lookup. For right-to-left searches, use INDEX/MATCH:=INDEX($B$2:$B$100,MATCH(A2,$A$2:$A$100,0)).
What if my data has duplicates?
VLOOKUP returns the first match only. If duplicates exist, the result depends on row order. To handle duplicates reliably, sort your data first or use a different method like XLOOKUP or FILTER (in Microsoft 365).Why does VLOOKUP return 0 instead of blank?
If the return cell is truly empty, Excel treats it as 0. Use=IF(VLOOKUP(...)=0,"",VLOOKUP(...)) or wrap in IFERROR to show blanks.
Is VLOOKUP case-sensitive?
No—it ignores case. “Apple” and “apple” are treated as matches. For case-sensitive lookups, combine INDEX/MATCH with EXACT:=INDEX($B$2:$B$100,MATCH(TRUE,EXACT($A$2:$A$100,A2),0)) (enter with Ctrl+Shift+Enter in older Excel versions).