fxExcelReps

← Blog

How to Fix Excel Errors: #N/A, #VALUE!, #REF! (Game)

It's Friday, the report is due, and the sheet is full of #N/A, #VALUE! and #REF!. Sound familiar? Play the game first, then read on: every error below comes with what it means and how to fix it for good.

{"src": "excel-errors"}

Excel error cheat sheet

Every Excel error is a short message in code. Once you can read it, most fixes take seconds.

Error What Excel is telling you Check first
#N/A "I can't find it." Extra spaces, typos, numbers stored as text, a missing FALSE in VLOOKUP
#VALUE! "That's the wrong kind of data." Text inside a calculation, like a dash or "n/a"
#REF! "That cell doesn't exist any more." Deleted rows or columns, a column number that's too big
#DIV/0! "You're dividing by zero." An empty or zero cell after the /
#NAME? "I don't know that word." A typo in a function name, text without quotes
#NUM! "That number is impossible." The square root of a negative number, an IRR with no answer
#SPILL! "Something is in my way." Cells under a dynamic array formula that aren't empty
#NULL! "Those ranges don't meet." A space instead of a comma or colon between two ranges
#CALC! "My result is empty." A FILTER that finds nothing
###### Not an error A column too narrow for the number, or a negative date

Speed round: name that error

Think you've got the table? Eight formulas, one question each.

{"title": "Speed round: name that error",
 "intro": "Which error does each formula return? Careful: a couple of them don't return an error at all.",
 "choices": ["#N/A", "#VALUE!", "#REF!", "#DIV/0!", "#NAME?", "#NUM!", "No error"],
 "questions": [
  {"f": "=SQRT(-9)", "a": "#NUM!", "why": "There's no real square root of a negative number, so the calculation is impossible."},
  {"f": "=MATCH(\"Zoe\",A2:A6,0)", "note": "A2:A6 holds five names, and Zoe isn't one of them.", "cells": {"A2": "Anna", "A3": "Boris", "A4": "Clara", "A5": "David", "A6": "Elena"}, "a": "#N/A", "why": "MATCH can't find Zoe, and *not found* is always `#N/A`."},
  {"f": "=\"5\"+5", "a": "No error", "why": "It returns 10. Excel quietly turns the text \"5\" into a number. It only gives up on text that doesn't look like one."},
  {"f": "=AVERAGE(B2:B9)", "note": "B2:B9 is completely empty.", "a": "#DIV/0!", "why": "There's no / in sight, but AVERAGE divides the total by the count, and an empty range has a count of 0."},
  {"f": "=VLOKUP(A2,D:E,2,FALSE)", "a": "#NAME?", "why": "VLOKUP is a typo. Excel doesn't know the word, so it says `#NAME?`."},
  {"f": "=INDEX(A1:A5,8)", "a": "#REF!", "why": "There's no 8th cell in a range of five, so the reference points nowhere."},
  {"f": "=\"Total\"*2", "a": "#VALUE!", "why": "You can't multiply a word. To join text with a number, use & instead: `=\"Total: \"&B9`."},
  {"f": "=DATE(2026,13,1)", "a": "No error", "why": "Excel rolls month 13 over into January 2027. Handy for adding months, surprising the first time."}
 ],
 "verdicts": [
  {"min": 8, "text": "**Error whisperer.** Excel has no secrets from you. 🏆"},
  {"min": 6, "text": "**Sharp eye.** Only the sneakiest ones got you. 💪"},
  {"min": 4, "text": "**Not bad.** The sections below fill in the gaps."},
  {"min": 0, "text": "**Errors are sneaky.** Read on, then come back and try again."}
 ]}

#N/A: Excel can't find what you're looking for

#N/A means not available. You get it from lookups (VLOOKUP, XLOOKUP, MATCH, INDEX/MATCH) when the value you're looking for isn't in the list, or when Excel thinks it isn't.

If you're sure the value is there, it's almost always one of these:

  1. An extra space. "Boris " with a space at the end isn't "Boris". Data pasted from emails, PDFs and web pages is full of them. =LEN(A2) tells the truth: a five-letter name with a length of 6 is carrying a passenger.
  2. A number stored as text. The ID 1024 in one table and the text "1024" in the other look identical, but they never match.
  3. A different spelling. "Jon" and "John", "Ltd" and "Ltd.".
  4. The wrong range. The lookup range stops too early, or doesn't start with the column you're searching in.

The names in column B look exactly like column A, but only TRIM makes them equal:

{"cells": {"A1": "In the list", "B1": "Pasted", "C1": "LEN(pasted)", "D1": "Same?", "E1": "After TRIM?", "A2": "Boris", "B2": "Boris ", "C2": "=LEN(B2)", "D2": "=A2=B2", "E2": "=A2=TRIM(B2)", "A3": "Anna", "B3": " Anna", "C3": "=LEN(B3)", "D3": "=A3=B3", "E3": "=A3=TRIM(B3)", "A4": "Clara", "B4": "Clara", "C4": "=LEN(B4)", "D4": "=A4=B4", "E4": "=A4=TRIM(B4)"}, "focus": "C2", "rows": 5, "note": "Spaces are invisible in a cell, but LEN counts them."}

How to fix it: wrap the lookup value in TRIM, or clean the whole column once with Ctrl+H (find a space, replace with nothing) if the values never contain a space inside. For numbers stored as text, see the silent bugs below.

When a value really is missing, say so in plain words with IFNA:

=IFNA(VLOOKUP(A2, Prices!A:B, 2, FALSE), "Not in the price list")

Need more than one column back? See VLOOKUP for multiple columns.

#VALUE!: the wrong kind of data

#VALUE! means a formula got a kind of value it can't work with. Nine times out of ten that's text where a number should be: a dash, "n/a", "TBC", or an amount pasted with a space inside.

The thing to remember: the + - * / signs fail on text, but SUM, AVERAGE and COUNT simply skip it.

Formula B2 = 900, C2 = "-"
=B2+C2 #VALUE!
=SUM(B2:C2) 900

That's why =SUM(B2:C2) is safer than =B2+C2 for adding up a row. But "skips text" cuts both ways: if real amounts are stored as text, SUM skips those too, and you get a wrong total with no warning at all. That's bug 8 in the game.

Two more classic causes: a date typed as text (31.12.2026 on a computer that expects 12/31/2026), and a text function such as MID asked to start at position 0.

#REF!: the formula points at a cell that's gone

#REF! appears when a formula refers to a cell that doesn't exist. There are two classic ways to get it:

  • You deleted a row or column the formula used. =B2+C2+D2 turns into =B2+C2+#REF! the moment column D is deleted. Excel can't repair that by itself: press Ctrl+Z straight away or fix the formula by hand.
  • You asked for something outside the range. =VLOOKUP(A2, A1:C9, 4, FALSE) wants the 4th column of a 3-column table. =INDEX(A1:A5, 8) wants the 8th cell of five.

How to avoid it: add up ranges instead of single cells (=SUM(B2:D2) survives a deleted column), prefer XLOOKUP or INDEX/MATCH to a typed column number, and before you delete a column, click one of its cells and use Formulas → Trace Dependents to see which formulas use it.

#DIV/0!: dividing by zero or by an empty cell

Nobody can divide by zero, and Excel is no exception. The usual culprit is an empty cell: Excel treats it as 0, so =B2/C2 with C2 blank gives #DIV/0!. AVERAGE of an empty range does it too, because an average divides by the count.

Fix it by testing the divisor first:

=IF(C2=0, "", B2/C2)

C2=0 is TRUE for a blank cell as well as for a real 0, so this one test covers both. Testing C2="" only catches the blank one, and that's the trap in bug 2.

#NAME?: Excel doesn't know that word

#NAME? means Excel found a word in your formula that it doesn't recognise. In order of how often I see it:

  1. A typo in a function name: =SUMM(A1:A9), =VLOKUP(…). Type =VL, pick the function from the list with Tab, and you can never misspell it.
  2. Text without quotes: =IF(A2>100, Big, Small). Text in a formula always goes in double quotes: "Big".
  3. A function your version of Excel doesn't have. XLOOKUP, FILTER, UNIQUE and LET don't exist in Excel 2016 or 2019, so a file built in Microsoft 365 shows #NAME? when it's opened there.
  4. A named range that was deleted or misspelled.

#NUM!, #SPILL!, #NULL! and #CALC!

These four are rarer, and each has one usual cause:

  • #NUM!: a calculation that's impossible or too big: =SQRT(-4), or an IRR that can't find an answer. Give IRR a starting guess, like =IRR(B2:B9, 10%).
  • #SPILL!: a dynamic array formula (UNIQUE, FILTER, SORT, SEQUENCE) wants to fill the cells below it, but something's in the way. Clear those cells: even a single space blocks it. More in Excel array formulas.
  • #NULL!: a space between two ranges, as in =SUM(A1:A5 B1:B5). In Excel a space means where these ranges overlap, and these don't. Use a comma for two ranges or a colon for one.
  • #CALC!: a newer error, mostly from a FILTER that finds nothing. Give FILTER its third argument: =FILTER(A2:C99, B2:B99="Paris", "None").

######: not an error at all

A cell full of hash signs isn't an error. The column is too narrow to show the number or date. Double-click the border to the right of the column letter and Excel widens it to fit. If it still shows ######, the cell holds a negative date or time, for example an end time earlier than the start time.

Silent bugs: worse than any error message

An error message is annoying, but it's honest: everybody can see something's wrong. The bugs that cost real money show a perfectly normal number. In my years of banking reports, these five caused more trouble than every #N/A put together. You met all of them in the game.

A range that stops too early

You add a row under the data and the total ignores it. Turn the data into a Table with Ctrl+T: a formula like =SUM(Sales[Amount]) grows with every new row.

A missing $

The formula is right in the first row and wrong in every row after it, because a reference that should stay fixed moved when you copied it down. Press F4 right after typing a reference to add the dollar signs: $B$1.

Numbers stored as text

Amounts pasted with a space, an apostrophe or a non-breaking space become text. SUM skips them, lookups don't match them, and the only hint is that they sit on the left of the cell. =ISNUMBER(A2) tells you for sure:

{"cells": {"A1": "Amount", "B1": "ISNUMBER", "A2": 2400, "B2": "=ISNUMBER(A2)", "A3": "1 250", "B3": "=ISNUMBER(A3)", "A4": 980, "B4": "=ISNUMBER(A4)", "A5": "3 100", "B5": "=ISNUMBER(A5)", "A7": "=SUM(A2:A5)", "B7": "← SUM", "A8": "=SUMPRODUCT(--SUBSTITUTE(A2:A5,\" \",\"\"))", "B8": "← real total"}, "formats": {"A2:A8": {"fmt": "number", "dec": 0}}, "focus": "A7", "rows": 9, "note": "Type 1250 (no space) in A3 and watch ISNUMBER and the SUM change."}

To fix a whole column at once: select it and use Data → Text to Columns → Finish, or Ctrl+H to replace the spaces with nothing.

VLOOKUP without FALSE

Leave out the last argument and VLOOKUP does an approximate match: when the code isn't there, it quietly returns the nearest smaller one. For IDs, codes and names, always finish with FALSE. Practise it in the VLOOKUP exercise.

Nested IFs in the wrong order

IF and IFS stop at the first test that's TRUE. Check the biggest threshold first, and use >= when the rule says "or more".

IFERROR: the fix that hides bugs

IFERROR is the most popular fix for errors, and the most dangerous one. It replaces every error with your value: not just the #N/A you expected for a missing customer, but also the #REF! from a deleted column and the #VALUE! from a typo. The error is gone. The bug is still there, now invisible.

I've seen reports where IFERROR(…, 0) turned a broken lookup into a column of zeros, and nobody noticed for months, because zeros look like data.

Both formulas below have the same bug: the price table has two columns, and they ask for column 3. Watch which one admits it:

{"cells": {"A1": "Code", "B1": "Price", "A2": 1001, "B2": 12, "A3": 1002, "B3": 18, "A4": 1003, "B4": 25, "D1": "Find", "D2": 1002, "E1": "IFERROR", "E2": "=IFERROR(VLOOKUP(D2,A2:B4,3,FALSE),\"Not found\")", "F1": "IFNA", "F2": "=IFNA(VLOOKUP(D2,A2:B4,3,FALSE),\"Not found\")"}, "focus": "E2", "rows": 5, "note": "Code 1002 is in the list, yet IFERROR says Not found. Change 3 to 2 in both formulas."}

My rules:

  1. For lookups, use IFNA. It catches only not found and lets real bugs through.
  2. When you know which error to expect, test for its cause instead: =IF(C2=0, "", B2/C2).
  3. Use IFERROR last, on a formula you've already checked, and never with 0 as the fallback in a column someone will add up.

How to find the cause in 30 seconds

When a formula breaks and the reason isn't obvious, these tools find it fast:

  1. Click the cell and press F2. Excel colours each reference in the formula and draws a box of the same colour around its cells. A range one row short jumps out.
  2. Select part of the formula and press F9. Excel shows what that part returns, for example the VLOOKUP inside an IF. Press Esc afterwards, or the result replaces that part of your formula.
  3. Formulas → Evaluate Formula (Alt M V) steps through the calculation one piece at a time, so you see exactly where the error starts.
  4. Formulas → Trace Precedents (Alt M P) draws arrows from every cell the formula uses, so you can follow an error back to where it began.
  5. Select every error at once: press F5, click Special, choose Formulas and tick only Errors. Excel selects all the error cells on the sheet.
  6. Ctrl+` (the key left of 1) shows formulas instead of results. The one formula in a column that's different from the rest stands out immediately.

More time-savers in Excel keyboard shortcuts.

Practise it

Reading about errors helps. Fixing them yourself is what makes it stick, and every exercise here is a real sheet with instant feedback:

  • IFERROR: replace an error with your own value, the right way
  • VLOOKUP and XLOOKUP: lookups without #N/A surprises
  • TRIM: remove the spaces that break lookups
  • IF and IFS: conditions in the right order

Haven't played yet? Back to the game ↑ When you've beaten 5 PM, try the free 12-question Excel test, the kind used in job interviews.

Practise the functions from this article

Every function has a short explanation and exercises in a real spreadsheet — your first 3 are free.

Start for free →

More articles

VLOOKUP vs XLOOKUP: 4 Traps That Give Wrong Answers

VLOOKUP can return a balance for an account that does not exist, with no error. Four traps from real banking reports and how XLOOKUP fixes them.

Free Loan Amortization Schedule Template for Excel

Download a free Excel loan amortization schedule with extra payments, payoff date, total interest and a balance chart. Type your loan and it updates instantly.

How to Find Unique Values in Excel (6 Ways)

Six ways to find unique values in an Excel column: COUNTIF, a sorted list, Advanced Filter, Remove Duplicates, UNIQUE and a pivot table. With live examples.