
Complete VLOOKUP Guide: Exact, Approximate, Left Lookup, Last Match, and Error Fixes
The VLOOKUP function is a vertical lookup function that finds a value in the first column of a table and returns a result from a column to its right. This guide is organized from Quick Fix → concepts → examples → troubleshooting → optimization, so you can go from beginner to real-world use in one place.
Need multiple criteria? Continue directly to VLOOKUP with Multiple Criteria.
Quick Fix (3-Minute Setup): Get Results with an Exact Match Now
- Set the table range: Select the
table_arrayrange, such as A1:D100. The lookup key (the value to find) must be in the first column. - Enter the lookup value: For example, enter an employee ID in cell F2.
- Formula (exact match):
=VLOOKUP(F2, $A$2:$D$100, 3, FALSE) - Absolute references: Lock the range with
$to prevent it from shifting when copied. - If an error occurs: First check for number-versus-text format mismatches (see the troubleshooting table below).
Basic Concepts and Syntax
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
- lookup_value: The value to find (for example, an employee ID or code)
- table_array: The table range. The first column must contain the lookup key, and the return column must be to its right.
- col_index_num: The return column number (counting 1, 2, 3… from the left side of the range)
- range_lookup:
FALSE(exact match),TRUE(approximate match)
Exact (FALSE) vs. Approximate (TRUE): Selection Guide
- Exact match (FALSE): No sorting required, with precise results. It can be relatively slower for large datasets with tens of thousands of rows or more.
- Approximate match (TRUE): The key column must be sorted in ascending order. It uses binary search internally, making it much faster with large datasets. It is useful for tiered lookups such as price lists or bracketed rates.
6 Practical Examples (Reproducible)
1) Employee ID → Department (Exact Match)
| EmpID | Name | Dept |
|---|---|---|
| 1001 | J.Kim | Sales |
| 1002 | A.Lee | HR |
| 1003 | M.Park | Finance |
| 1004 | S.Choi | Sales |
| 1005 | E.Han | IT |
| 1006 | R.Lim | IT |
=VLOOKUP(F2, $A$2:$C$8, 3, FALSE) — If F2=1005, it returns IT.
2) Code → Price List (Approximate Match, Keep Sorted)
After sorting the code column in ascending order:
=VLOOKUP(H2, $B$2:$C$20000, 2, TRUE)
- Very fast with large datasets (if the sort order is broken, incorrect results are possible → using an automated sorting macro or an Excel table is recommended).
3) Two-Way Lookup (VLOOKUP+MATCH)
When row B4:E4 contains Jan, Feb, Mar, Apr:
=VLOOKUP(H4, $B$5:$E$16, MATCH(H5, $B$4:$E$4, 0), 0)
Returns the value at the intersection of the customer row in H4 and the month column in H5.
4) Find a Customer with a Partial Match (Wildcards)
*: Zero or more characters;?: Any single character
=VLOOKUP("JK*", $A$2:$C$8, 2, FALSE)
5) Left Lookup — Use an Alternative
Because VLOOKUP requires the return column to be on the right, it cannot perform a left lookup directly. Use one of the following alternatives.
- INDEX/MATCH:
=INDEX(B:B, MATCH(H2, C:C, 0)) - XLOOKUP:
=XLOOKUP(H2, C:C, B:B, "Not found")(can look left or right and provides an if_not_found message)
6) Get the Last Match (Bottommost Item)
=INDEX($B$1:$B$20, MAX(IF($A$1:$A$20=H2, ROW($A$1:$A$20)-ROW($A$1)+1)))
With dynamic arrays (Office 365), you can improve readability further by combining LET and FILTER.
Troubleshooting (Symptom | Cause | Solution)
| Symptom | Cause | Solution |
|---|---|---|
| #N/A | Value not found or number-versus-text format mismatch | Standardize the lookup key and key-column formats (use VALUE/TEXT if needed), then clean up in bulk with Data > Text to Columns |
| #REF! | col_index_num exceeds the range | Adjust the column number so it is within the range (using an Excel table or structured references is recommended) |
| #VALUE! | Invalid argument format | Check that col_index_num is an integer and that range references are valid |
| Incorrect value (approximate) | Missing or broken sort order | Keep the key column in ascending order and implement automatic sorting for updates (macro/Power Query) |
Performance Optimization (Essential for Large Datasets)
- Approximate match (TRUE) + ascending sort = major speed gains through binary search.
- Exact match (FALSE) uses a linear search, so performance can noticeably decline with 100,000 rows or more. Consider XLOOKUP/XMATCH where possible.
- Manage data as an Excel table (CTRL+T) for automatic range expansion and structured references.
- Minimize repeated calculations: create helper columns (normalization), separate calculation areas, and preprocess with Power Query/PivotTables when needed.
Checklist (Avoid Mistakes)
- The lookup key must be in the first column, with the return column on the right.
- Wildcards
*/?can be used with exact matches. - Approximate matches depend on ascending sort order (a broken sort order produces incorrect results).
- Do not let
col_index_numexceed the range. - Use INDEX/MATCH or XLOOKUP for left lookups and last-match lookups.
Related Articles
- XLOOKUP vs. VLOOKUP: Which Should You Use?
- Summarize Multiple Criteria with SUMIFS
- Fix Common Excel Errors in One Place
- Complete TEXTSPLIT Guide
References: Oppadu Excel’s VLOOKUP page, official Microsoft documentation, and the Exceljet function reference.