How to Use VLOOKUP in Excel: Step-by-Step Guide
The VLOOKUP (Vertical Lookup) function is the backbone of data merging in Excel and Google Sheets. Whether you are reconciling invoices, searching for employee IDs, or matching product prices, mastering VLOOKUP will save you hours of manual work.
VLOOKUP Syntax Explained
The VLOOKUP formula follows this structure:
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
- lookup_value — the value you want to search for (e.g.,
A2or"Apple") - table_array — the entire range containing both the lookup column and the result column (e.g.,
$A$2:$D$100) - col_index_num — the column number in the table_array that holds the return value (1 = first column, 2 = second, etc.)
- range_lookup —
FALSEfor exact match,TRUEfor approximate match. Always useFALSEfor IDs and exact values.
Real-World VLOOKUP Example: Employee Lookup
Imagine you have an employee table in cells A2:D10:
| A | B | C | D |
|------------|------------|------------|------------|
| EmployeeID | FirstName | LastName | Department |
| 101 | Alice | Johnson | Sales |
| 102 | Bob | Smith | Marketing |
| 103 | Carol | Davis | Engineering|
To find Carol's department using her employee ID 103 in cell G2:
=VLOOKUP(G2, A2:D10, 4, FALSE)
This tells Excel: "Find 103 in column A, go to the 4th column of the range (column D), and return the value from that row." The result is "Engineering".
Step-by-Step VLOOKUP Walkthrough
- Identify the lookup value. Put the value you want to search for in a cell (e.g., type
103intoG2). - Select the table array. Highlight the entire data range including both the lookup column and the return column. Always use absolute references like
$A$2:$D$10so the range doesn't shift when you copy the formula. - Count the return column. In our table, Department is the 4th column of the range
A2:D10, socol_index_num = 4. - Set match type to FALSE. For exact matches on IDs, names, or codes, always use
FALSE. UseTRUEonly for grade brackets, tax tables, or price tiers where you want the nearest match. - Press Enter and verify. The formula returns the department. Copy it down to look up all employees at once.
Common Pitfalls to Avoid
- The Left-to-Right Rule: VLOOKUP can only search for a value in the leftmost column of your range. If your lookup value is to the right of your result, VLOOKUP won't work — use XLOOKUP or INDEX/MATCH instead.
- Approximate vs. Exact Match: Always use
FALSEor0as the last argument for exact matches (IDs, names, SKUs). UsingTRUEon unsorted data returns random-looking results. - Static Column Index: Hardcoding
3as col_index_num breaks if you insert a new column in the table_array. Use named ranges or switch to XLOOKUP for dynamic column references. - Missing Absolute References: Without
$signs (e.g.,$A$2:$D$10), copying the formula down shifts the table array and produces wrong results. - Data Type Mismatch: A number stored as text (e.g.,
"123"vs123) will cause #N/A. UseVALUE()orTEXT()to align types.
VLOOKUP vs XLOOKUP vs INDEX MATCH
| Feature | VLOOKUP | INDEX MATCH | XLOOKUP |
|---|---|---|---|
| Lookup direction | Right only | Any direction | Any direction |
| Column insertion safe? | No (breaks index) | Yes | Yes |
| Default value on miss | #N/A | #N/A | Custom (if_not_found) |
| Return entire row | No | No | Yes (return array) |
| Case sensitivity | No | With EXACT() | With EXACT() |
| Ease of use | Easy | Moderate | Easy |
| Available in | All Excel versions | All Excel versions | Excel 365 / 2021 |
Bottom line: Use VLOOKUP for quick one-off lookups in stable tables. Use INDEX MATCH when you need flexibility or lookups to the left. Use XLOOKUP if you have Excel 365 — it is the most powerful and intuitive option.
Using VLOOKUP Across Multiple Sheets
You can VLOOKUP into another worksheet by referencing the sheet name in the table_array:
=VLOOKUP(A2, 'Sheet2'!$A$2:$D$100, 4, FALSE)
For a different workbook (assuming it is open):
=VLOOKUP(A2, '[SalesData.xlsx]Orders'!$A$2:$D$100, 4, FALSE)
Important: If you close the external workbook, the formula continues to work with cached values. Re-open the source file to refresh.
5 VLOOKUP Edge Cases You Should Know
- #N/A when value exists: The lookup value might have trailing spaces. Wrap lookup_value in
TRIM():=VLOOKUP(TRIM(A2), $A$2:$D$10, 4, FALSE). - Matching partial text with wildcards: Use
*for any sequence of characters:=VLOOKUP("*"&TRIM(A2)&"*", $A$2:$D$10, 4, FALSE). This finds cells that contain the search term anywhere. - VLOOKUP returning 0 instead of blank: If the result cell is empty, VLOOKUP returns 0. Wrap with
IF:=IF(VLOOKUP(...)="", "", VLOOKUP(...))or useIFERRORfor a cleaner fallback. - VLOOKUP with dynamic column index using MATCH: Combine VLOOKUP with MATCH to make the column index dynamic:
=VLOOKUP(A2, $A$2:$D$10, MATCH("Department", $A$1:$D$1, 0), FALSE). This finds "Department" in the header row and returns the correct column number automatically. - VLOOKUP with IFERROR for clean output: Wrap VLOOKUP in
IFERRORto display a friendly message instead of #N/A:=IFERROR(VLOOKUP(A2, $A$2:$D$10, 4, FALSE), "Not Found").
Pro Tip: Before writing VLOOKUP, always check that your lookup column is the first column in the range. If it isn't, switch to XLOOKUP or INDEX MATCH — both can search any column in any direction.
Pro Tip #2: Lock your table_array with absolute references ($A$2:$D$10) before dragging the formula down. For even better maintainability, convert your data range into an Excel Table (Ctrl+T) so you can use structured references like Table1[#All] that never break.
Common Errors & Fixes
VLOOKUP returns #N/A
Causes:- Lookup value not in the first column of table_array.
- Data type mismatch (number vs text, e.g. 123 vs "123").
- Extra spaces or different formatting in lookup value or table.
Fixes:- Ensure the column you search is the leftmost in table_array.
- Use TRIM and VALUE or TEXT to align types; check for leading zeros.
- Use TRIM on both sides or normalize with VALUE/TEXT.
Wrong column returned
Causes:- col_index_num is 1-based; counting from 1, not 0.
- Inserted columns shifted the return column; index not updated.
Fixes:- Count columns from the first column of table_array (1 = first column).
- Use INDEX/MATCH or XLOOKUP to avoid column index breakage.
Frequently Asked Questions
Why is VLOOKUP returning #N/A?
Can VLOOKUP look to the left?
What is the difference between VLOOKUP and XLOOKUP?
How to use VLOOKUP with multiple criteria?
Why is VLOOKUP not working?
Is VLOOKUP case sensitive?
How to fix VLOOKUP #REF error?
Should I use VLOOKUP or INDEX MATCH?
How to use VLOOKUP with wildcard characters?
Why is VLOOKUP returning the wrong column?
How to use VLOOKUP across different worksheets?
Related Formulas
Explore related formula generators to solve similar problems
🛠️ Related Tools
Want to become an Excel Pro?
Stop searching for formulas. Master Excel in 30 days with this top-rated course.
Learn More