Fixing #VALUE! error when using VLOOKUP function in Excel
#VALUE! is one of the most common errors when using the VLOOKUP function, but it is also the error that makes many people “sweat”. The #VALUE! error usually indicates that the formula containing the VLOOKUP function is not correct in some way. This error will also appear if you have used an incorrect reference to the cells in your formula, especially if you use a data range from another workbook. In this article by Buffcom.net, we will guide you on how to fix the #VALUE! error when using the VLOOKUP function in Excel.
1. #VALUE! error due to lookup value exceeding 255 characters
The VLOOKUP function only supports users to search for values of 255 characters or less. Therefore, if the value to be looked up is longer than 255 characters, the VLOOKUP function will return the #VALUE! error as shown below.
To solve this problem, you can use the INDEX and MATCH functions nested together to replace the VLOOKUP function. We have the search formula in cell B11 as follows:
=INDEX(C2:C7,MATCH(TRUE,INDEX(A2:A7=A11,0),0))
Since the INDEX and MATCH functions are not limited to the number of characters, the result can be returned normally.
2. #VALUE! error due to incomplete path to the lookup worksheet
If you are taking data from another worksheet, you must include the full path to that file. More specifically, you must include the name of the file (including the extension) in square brackets [], and then specify the name of the worksheet and the dot. If any element of the path is missing, your VLOOKUP formula will not work and return the #VALUE! error.
This is the complete formula structure of VLOOKUP for looking up data from another worksheet:
= VLOOKUP (lookup_value, ‘[file name]worksheet name’! Table_array, col_index_num, FALSE)
For example, the formula in the image below is as follows:
=VLOOKUP(A11;[Excel.xlsx]Sheet1!$A$1:$E$7;3;FALSE)
This formula will search for the value of cell A11 in the A1:E7 table in Sheet1 Excel file and return a matching value in column 3.
3. #VALUE! error due to col_index_num argument less than 1
Another common case that causes the #VALUE! error when using the VLOOKUP function is the col_index_num argument being less than 1.
To handle this case, it is quite simple. You just need to check the col_index_num argument and correct it to be correct. For example, in this case, we need to fix the col_index_num argument to be 3.
In conclusion, Excel’s VLOOKUP function is a powerful tool for searching and retrieving data in a spreadsheet. However, it can produce the #VALUE! error message if used incorrectly, causing frustration for many users. The three solutions we’ve outlined in this article can help resolve this error: using INDEX and MATCH functions instead of VLOOKUP for longer search values, providing the full path to the lookup table when using data from a different workbook, and making sure that the col_index_num parameter is not less than 1. By understanding these common mistakes and how to fix them, you can use VLOOKUP more effectively and avoid the #VALUE! error.