How to fix #REF!, #N/A, #VALUE!, #DIV/0! and #NAME? errors in Excel and Google Sheets
A spreadsheet error isn't random. Each one tells you what went wrong. This guide covers the five you'll see most, what causes each one, and how to fix it so it stays fixed. Everything here works in both Excel and Google Sheets unless it says otherwise.
Before you start: find where the error begins
One broken cell can spread an error down a whole column and into every total that uses it. Fixing the last cell in the chain does nothing.
- Click the cell with the error and look at its formula.
- In Excel, use Formulas > Trace Precedents (or Trace Error) to see which cells feed it. In Google Sheets, click each cell reference in the formula bar; the source cells are highlighted.
- Follow the chain back until you find the first cell that shows an error. Fix that one first, then check whether the others clear on their own.
- Work on a copy. Save one as "backup" before you change anything.
#REF! — the formula points at a cell that's gone
What causes it: a row, column or sheet the formula used was deleted, or a formula was copied somewhere its references don't make sense (for example, a reference that ends up above row 1).
How to fix it:
- If you just deleted something, undo (Ctrl+Z) and remove the data instead of the row or column.
- Otherwise, open the formula and replace each #REF! inside it with the right cell or range.
- To stop it happening again, use whole-column or named ranges (for example =SUM(Sales[Amount]) in an Excel table) so inserting or deleting rows doesn't break the reference.
#N/A — a lookup can't find what it's looking for
What causes it: VLOOKUP, XLOOKUP, MATCH or INDEX/MATCH is searching for a value that isn't in the lookup range. Usually it is there, but it doesn't match exactly.
Common reasons, in order of how often we see them:
- Extra spaces. "Smith " is not "Smith". Wrap the lookup value in TRIM(), or clean the column with TRIM.
- Numbers stored as text. A product code "1042" typed as text won't match the number 1042. Look for little green triangles (Excel) or left-aligned numbers. Convert with VALUE() or by multiplying by 1.
- The range doesn't cover all the data. A VLOOKUP on A2:C100 misses row 101. Use whole columns or a table.
- VLOOKUP with the last argument left blank or TRUE does an approximate match on unsorted data and returns wrong answers or #N/A. Use FALSE (or 0) for an exact match.
When "not found" is a normal answer, show something cleaner: =IFNA(VLOOKUP(A2,Prices!A:C,3,FALSE),"Not listed"). Use IFNA rather than IFERROR here so real mistakes elsewhere in the formula still show up.
#VALUE! — the formula got the wrong kind of data
What causes it: math on something that isn't a number: text, a space that looks blank, or a date typed in a format the sheet doesn't recognize.
How to fix it:
- Check each cell the formula uses. A cell that looks empty may contain a space. Select it and press Delete.
- Dates pasted from other systems often arrive as text. If a date is left-aligned, it's probably text. Use DATEVALUE() or Data > Split text to columns to convert it.
- =A2+B2+C2 fails if any one cell is text. =SUM(A2:C2) skips text and adds the numbers. That can hide bad data, so fix the source cells if you can.
#DIV/0! — dividing by zero or by a blank cell
What causes it: the bottom number of a division is 0 or empty. It's common in averages, percentages and "cost per unit" columns before data is filled in.
How to fix it: decide what the cell should show when there's nothing to divide by, and say so in the formula:
- =IF(B2=0,"",A2/B2) leaves the cell blank until there's data.
- =IFERROR(A2/B2,0) works too, but it hides every other error in the formula as well, so use it carefully.
- For averages, AVERAGEIF(range,"<>0") skips zeros if zeros mean "no data yet".
#NAME? — the sheet doesn't recognize a word in the formula
What causes it: a misspelled function (=SUMIF is right, =SUMIFF is not), text that isn't in quotes, a named range that was deleted, or a newer function your version doesn't have.
How to fix it:
- Check the spelling of every function. Start typing it and pick from the list so the spelling is right.
- Put text in double quotes: =COUNTIF(A:A,"Paid"), not =COUNTIF(A:A,Paid).
- If the file came from someone with a newer Excel, functions like XLOOKUP, FILTER or LET may not exist in older versions. Google Sheets supports most of them.
Make the fix stick
- Turn ranges into tables (Excel: Ctrl+T; Google Sheets: Format > Convert to table) so formulas grow with your data.
- Add drop-down lists (Data > Data validation) to columns where people type the same few values. Most lookup errors start as typos.
- Protect formula cells so nobody types over them. Excel: Review > Protect Sheet. Google Sheets: Data > Protect sheets and ranges.
- Keep inputs and math apart. Data goes on one tab, calculations on another. It's much easier to find problems.
- Write down what each tab does on a notes tab. The next person to open the file will thank you, and that person is often you in six months.
When it's faster to hand it off
If the file was built by someone who's gone, the formulas run across a dozen tabs, or you've spent an evening on one error, it may be quicker to have someone else trace it. Send the file, say what it should do, and get it back fixed with a list of every change made.