How to do a vlookup without errors in Google Sheets? Take a closer look at the most common mistakes made when working with the VLOOKUP function.
Google Sheets VLOOKUP is one of the most useful yet trickiest functions. It helps finding matching data across multiple sheets. However, there are cases when your formula may return errors like #N/A, #NAME?, #VALUE!, or #REF!.
Let's try and answer the following question together, "Why my Google Sheets VLOOKUP isn't working?"
Most common VLOOKUP mistakes
The first reason is that there are simply no matches in the range you indicated. You're powerless here and can't affect the result.
Other cases mean that you've made a mistake somewhere in the formula. Let's take a closer look at what may have gone wrong.
Delimiters are those characters that are used in formulas as separators. For example, if you are in the UK or the US, chances are your formulas require commas as delimiters:
And it is your spreadsheet locale that controls the separator choice. Different locales call for different separators.
To check your locale in Google Sheets, go to File > Settings. You'll see the locale under the General tab:
To understand what delimiters your VLOOKUP needs based on your locale, just start entering the function. Google Sheets will show you what your formula should look like exactly and what separators must be used:
If the delimiters are all correct but your Google Sheets VLOOKUP still fires errors, check other possible issues and their solutions below.
Incorrect data – #N/A error
The formula can't find anything and returns the #N/A error? But you're sure there's got to be a match?
The simplest solution is the best here – most likely, you entered the data into the formula incorrectly. This may happen especially if you type the formula directly into the formula bar rather than the cell.
Fix this #N/A error
Double-check all arguments, make sure all cell references and values are correct.
Or add your own text for when there's really no match.
Incorrect function name – #NAME? error
If you see the #NAME? error, you either wrote the function name incorrectly (missed or misspelled a letter or two) or got mixed up with the syntax.
Fix the #NAME? error
Check the function name and the VLOOKUP syntax. Correct all the typos, and everything will work.
Invalid VLOOKUP cell references – #N/A error
The formula worked just fine until you added a few rows or columns into the table and the #N/A error appeared out of the blue?
Fix this #N/A error
Check if the search range and the cell with the value to look for are entered correctly – they are neither misspelled nor absent from the sheet.
Note. If you use relative cell references (e.g. A1) instead of absolute ones (e.g. $A$1) and then modify the table (e.g. add a column), the data will shift, the references will change, and the formula will refer to wrong cells:
I added the "ID" column. The "Price" column is not included in the range anymore, thus the price cannot be found.
If that happens, simply Undo the table modifications and fix the references.
Tip. You can use the Formulas tool from the Power Tools add-on to convert all relative references to absolute in a couple of clicks:
Incorrect "is_sorted" argument
Your Google Sheets VLOOKUP formula is set to return approximate match (TRUE), while the lookup column is not sorted.
To fix that, either sort the lookup column A to Z or change TRUE to FALSE.
Incorrect lookup range – #N/A error
You may have forgotten that the VLOOKUP function in Google Sheets always searches in the first (leftmost) column of the lookup range. If the values for the search_key argument are in the second or some other column, VLOOKUP won't work and will return the #N/A error:
Note. Remember: VLOOKUP cannot look at its left. With that in mind, adjust your table or the formula. Or use INDEX/MATCH instead.
Fix this #N/A error
Note. Remember: VLOOKUP cannot look at its left.
With that in mind, adjust your table or the formula. Or use INDEX/MATCH instead.
Incorrect column number – #VALUE! error
Sometimes the third argument of Google Sheets VLOOKUP is indicated incorrectly.
It cannot be less than 1 and more than the total number of columns in the search range. If the number is incorrect, VLOOKUP in Google Sheets will return the #VALUE! error.
Note. The number of the column should be 1 or more. Of course, it's unlikely that you'll enter 0 or -1, but if you use some other functions to get the serial number of the required column, you may stumble upon the error.
Fix the #VALUE! error
If that happens, please count the number of columns in the entered range and make sure it includes the number from the third argument of the VLOOKUP function.
Invalid reference to another table – #REF! error
The search range can be in another table or even another Google spreadsheet.
You'll notice that something's off if you see the #REF! error.
It means that the range you put into the formula is invalid and the function cannot locate it.
Incorrect Number format – #N/A error
This means that the format of the cell with a required value (D3 in our case) and the format of the leftmost column in the search range (A3:A21 in our case) differ (numeric and textual).
This may happen when you use numeric codes instead of textual entries (order numbers, goods IDs, dates, and other identifiers).
As the example above shows, the values look the same but the entry in D6 is formatted as a number while A10 contains a text string. The text cannot be treated as a number, making the VLOOKUP function in F6 return the #N/A error in Google Sheets.
Fix this #N/A error – change the format
If there's only one error like this, you can swiftly fix it by changing the cell's number format. Select the cell and go to Format > Number > Plain text in the Google Sheets menu. Its contents will be changed into the text:
Do that, and the error will be gone since you'll be looking for the text string among other text strings.
Fix this #N/A error – use the TEXT function
Alternatively, you can add the TEXT function that will transform any values into text.
I use the following formula:
I replaced the usual cell reference to D6 with another function:
The arguments of the TEXT function are very simple:
- The first argument, number, indicates the cell to format.
- The second argument, format, is a pattern to which I'm going to convert the value of the cell.
Excess spaces and non-printing characters – #N/A error
The function is unable to find the required value since the cell contains excess spaces or non-printing chars (line breaks and others).
In my example, Google Sheets VLOOKUP is not working because there are two trailing spaces typed into D4 accidentally. And since the function compares symbols, the search fails:
This problem is quite common and invisible to the eye. For example, if the value consists of two words, an excess space may find its way in between the words.
You may also accidentally enter such non-printing characters that are hidden on the screen (tabulations, line breaks, etc).
Fix this #N/A error – use TRIM and CLEAN functions
The TRIM and CLEAN functions that are designed for text strings will help and remove unwanted invisible characters:
The TRIM function removes extra spaces while the CLEAN function deletes all non-printing characters.
Tip. You can always use this combination of functions "just in case" to avoid any errors.
Fix this #N/A error – use a special tool to trim spaces
Or use the Remove tool from Power Tools to delete all unwanted characters at once:
Replace VLOOKUP errors with your own text
I think you will agree that errors don't make your table look good. Is there a way to get rid of them?
Well, yes, but it won't hurt to first double-check if your VLOOKUP formula in Google Sheets was built correctly:
- Start with the lookup range. Did you put it correctly? Does your value appear in the leftmost columns of this range?
- Make sure the "is_sorted" argument is correct: TRUE or FALSE, depending on the match you need and the sorting of your range.
- Check for all possible number formats mismatches and extra spaces or non-printing chars.
Tip. Avoid using VLOOKUP errors by switching to other more powerful ways of fetching the data.
If everything looks fine yet the formula doesn't return the value, add the IFERROR function there:
The syntax of IFERROR is easy to understand:
- value – something we check for errors. If everything's fine, the result of our calculation returns.
- [value_if_error] – something the function returns if the first argument catches an error.
In my case, F9 shows "No match" because VLOOKUP can't find any matches.
This is how you check your VLOOKUP function for errors in Google Sheets. If you double-check all these but your formula still won't work, let us know in the comments sections below.