Why is the vlookup function not working
Tutor 5 (55 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
The VLOOKUP function may fail or produce unexpected results due to several common issues. Each reason has a specific condition and solution.
1. Incorrect Lookup Value
VLOOKUP searches for an exact match or approximate match in the first column of a table. The function fails when the lookup value does not exactly match the values in that column.
-
Condition: Spaces, hidden characters, or mismatched data types (numbers stored as text) exist in the lookup column.
-
Solution: Use the
TRIM()function to remove extra spaces and ensure data types match. Convert numbers stored as text into proper numeric format.
2. Column Index Number Is Wrong
VLOOKUP requires a column index number to return the corresponding value from the table.
-
Condition: The column index number exceeds the number of columns in the table array.
-
Solution: Count the columns in the table array and ensure the column index number is within the range.
3. Approximate Match Instead of Exact Match
By default, VLOOKUP may use an approximate match if the fourth argument, range_lookup, is omitted or set to TRUE. This can cause unexpected results.
-
Condition: Lookup value is not sorted in ascending order and
range_lookupis set to TRUE. -
Solution: Set
range_lookupto FALSE to force an exact match:=VLOOKUP(lookup_value, table_array, col_index_num, FALSE)
4. Merged Cells in the Table
VLOOKUP does not work reliably with merged cells in the lookup column.
-
Condition: Merged cells break the uniformity of the lookup column.
-
Solution: Unmerge cells and fill the values correctly in each row.
5. Lookup Column Is Not the First Column
VLOOKUP always searches in the first column of the selected table array.
-
Condition: Lookup value is in a column that is not the first column of the table array.
-
Solution: Adjust the table array to start from the lookup column or use
INDEX-MATCHas an alternative.
6. Extra Spaces or Non-Printable Characters
Even a single space or non-printable character can prevent VLOOKUP from finding a match.
-
Condition: Data copied from external sources often contains hidden characters.
-
Solution: Clean the data using:
=CLEAN(TRIM(A1))
7. Incorrect Data Types
VLOOKUP distinguishes between numbers and text. Numbers formatted as text do not match numeric lookup values.
-
Condition: Lookup value is numeric but stored as text, or vice versa.
-
Solution: Convert the data types to match. Use
VALUE()to convert text to numbers orTEXT()to convert numbers to text.
8. File or Worksheet References Are Broken
When using VLOOKUP across workbooks, broken links or closed workbooks can cause errors.
-
Condition: The external workbook is moved, renamed, or closed.
-
Solution: Keep the external workbook open or update the links in Excel.
9. Case Sensitivity
VLOOKUP is not case-sensitive. If exact case matching is required, it will fail.
-
Condition: Lookup requires matching uppercase and lowercase letters exactly.
-
Solution: Use
INDEX-MATCHwithEXACT()instead of VLOOKUP.
10. Error Handling
Errors like #N/A or #REF! appear when no match is found or when references are invalid.
-
Condition: Lookup value does not exist in the table.
-
Solution: Use
IFERROR()to manage errors:=IFERROR(VLOOKUP(lookup_value, table_array, col_index_num, FALSE), "Not Found")
These conditions cover most reasons why VLOOKUP might not work. Cleaning the data, ensuring correct ranges, and confirming the lookup type usually resolves the problem.
. Was this Helpful?Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
Why is today function not working
Answers · 1
How to extract date from datetime in excel
Answers · 1
Why is the date value not working
Answers · 1
How to create a date formula
Answers · 1