When a lookup function in Google Sheets is not working, the culprit is almost always one of four things: a type mismatch between the search key and the lookup range (numbers stored as text are the classic case), a range that does not include the column you are returning, missing or mismatched headers in VLOOKUP's exact-match mode, or stray spaces and non-printing characters in the data. Fix those first and most #N/A errors vanish. Below is the order to check things in, with the exact formula to use at each step.
What You'll Need
- Edit access to the Google Sheet (view-only access will not let you change formulas)
- A desktop browser for the quickest checks; the mobile Sheets app can edit formulas but is slower for inspecting ranges
- Knowledge of which lookup function the sheet uses: VLOOKUP, HLOOKUP, XLOOKUP, INDEX/MATCH, or LOOKUP
- Access to the source data if the lookup pulls from another tab or a second spreadsheet
Step-by-Step
- Read the actual error. Click the cell with the broken formula. Sheets shows a small warning icon with a message such as "Did not find value '123' in VLOOKUP evaluation" or "VLOOKUP evaluates to an out-of-bounds range." The wording tells you which fix applies: "did not find" is a data mismatch; "out-of-bounds" is a range that is too narrow.
- Check that the key matches the data type. In a blank cell, type
=ISNUMBER(A2)(replace A2 with the cell holding your search key) and=ISNUMBER(Sheet2!A2)for the first cell of the lookup range. If one returns TRUE and the other FALSE, the two will never match. Convert them with=VALUE()or=TEXT(...,"0"), or force both into text with&"". Numbers pasted from other systems frequently arrive with a leading apostrophe and are stored as text. - Trim invisible characters. Leading, trailing and repeated spaces break exact matches. Wrap both sides in
TRIM:=VLOOKUP(TRIM(A2),TRIM(B:B),2,FALSE). In older sheets this needsARRAYFORMULAaround it, or you can build a helper column with=TRIM(A2)and look that up instead. Non-breaking spaces from a copied web page are not removed by TRIM; use=SUBSTITUTE(A2,CHAR(160),""). - Confirm the range includes the return column. VLOOKUP can only return columns to the right of the key. If the value you want sits to the left, switch to
XLOOKUPorINDEX/MATCH, both of which handle either direction. - Lock the range for filling down. Press F4 after selecting the range to add dollar signs, e.g.
$A$2:$D$100, so the range does not drift as you copy the formula down the column. - Use exact match, not approximate. Leave the fourth argument of VLOOKUP as
FALSE(or0). Omitting it or writingTRUEmakes Sheets assume the first column is sorted and return the nearest value, which produces wrong results that look plausible. - Test the range in isolation. Select the range, look at the bottom-right of the window, and Sheets shows a Count and Sum. A Count lower than you expect, or a Count that disagrees with the name box's row count, means blank rows or text in a supposedly numeric column.
- Swap in XLOOKUP if the sheet allows it.
=XLOOKUP(A2,Sheet2!A:A,Sheet2!D:D,"not found")removes the column-counting problem, searches left or right, and gives you a clean fallback text instead of #N/A. - Handle errors deliberately. Wrap the formula in
IFNAto catch only "no match" errors:=IFNA(VLOOKUP(...),""). UseIFERRORonly if you also want to hide genuine syntax errors, which can mask a broken formula for weeks.
Common Mistakes
- Mixed data types. One table has employee IDs as numbers, the other as text. Nothing matches, and nothing looks wrong on screen.
- Off-by-one column index. Count columns from the first column of the range, not from column A of the sheet. People increment the index when they add a column to the source, and then increment it again by mistake.
- The range starts one row below the header. Exact-match VLOOKUP works with or without headers, but people often hardcode an index that assumes the header row, then change the range and break it.
- Trailing spaces from paste or import. A CSV import almost always brings whitespace with it.
- Case sensitivity confusion. VLOOKUP, XLOOKUP and MATCH ignore case by default. If you need a case-sensitive match, that is a different formula (
EXACTcombined withFILTER), not a setting. - Wildcards in the key. An asterisk or question mark in the lookup value is treated as a wildcard, so a literal
*in a product code needs escaping with~*. - Unlocked references. Filling a formula down without absolute references shifts the range row by row and the last few rows return #N/A.
Tips
- Build a helper column that normalises both sides (trimmed, uppercased, text-forced) and look that up instead. It is easier to debug than a nested monster formula.
- Keep the lookup key in the leftmost position of your source table and your source table sorted, even when you use exact match. It makes approximate lookups and manual checking far easier.
- Use a named range for the source table (Data > Named ranges) so you reference it by name and never break it by inserting a column in the middle.
- Click a reference inside the formula bar and Sheets highlights the range in colour on the grid. That is the fastest way to see an off-by-one range.
- If the source is in another spreadsheet, use
IMPORTRANGEand confirm you have authorised the connection. An unauthorised import returns an error that cascades into #N/A on every lookup.
Troubleshooting
Every row returns #N/A. The key and range almost certainly differ in type. Run the ISNUMBER check on both sides, then fix with VALUE or TEXT.
Some rows work and others return #N/A. That points to individual dirty records: trailing spaces, a stray apostrophe, or blank rows in the source. Use a helper column of =TRIM() and compare the length of each key with =LEN().
Results are wrong but not errors. You are in approximate-match mode, or the column index is off. Set the fourth argument to FALSE and recount the columns from the range start.
#REF! appears. A column was deleted from the source, so the index now points outside the range. Widen the range or lower the index.
#VALUE! appears. Usually a text value is being used where a number is expected, or the range syntax is malformed. Check for a missing comma or an unclosed parenthesis.
The formula worked yesterday and broke today. Ask whether the source tab was renamed, sorted differently, or imported fresh. Renaming a referenced tab breaks every formula pointing at it, so check the tab names at the bottom of the window.
Frequently Asked Questions
Why does VLOOKUP return #N/A when the value clearly exists?
Almost always a data-type or whitespace mismatch. One value is a number and the other is text, or one has a trailing space. Compare with =A2=Sheet2!A2: if it returns FALSE, the values are not identical even though they look the same.
Can XLOOKUP replace VLOOKUP in Google Sheets?
Yes, XLOOKUP is available in Google Sheets and is the better choice for new formulas. It searches in either direction, does not need a column count, and lets you set a fallback value.
Why do my results shift after I fill the formula down?
The range is not absolute. Add dollar signs to the range, $A$2:$D$100, or select the range and press F4 before copying down.
Does VLOOKUP match case?
No. VLOOKUP, XLOOKUP and MATCH are case-insensitive in Google Sheets. For case-sensitive matching, use a formula built on EXACT.
Why does a lookup into another spreadsheet fail?
The import may not have been authorised. Open the cell with the IMPORTRANGE formula and click to allow access, then check that the sheet name and range in the formula still match the source file.