Excel course · Lesson 23 of 34

Formula errors: what each one means and how to fix it

Diagnose #N/A, #VALUE!, #REF!, #DIV/0!, #NAME?, #SPILL!, #CALC!, #NUM! and #NULL!, and use Trace Precedents, Evaluate Formula and the Watch Window.

Intermediate 18 min read

Every Excel user meets error values. They are not a sign of failure: each error code is Excel telling you precisely what went wrong. Learn to read them and you will fix most formulas in seconds. This lesson explains each error, its usual causes and fixes, and then the auditing tools that let you trace a problem through a large workbook.

The error values

ErrorMeaningTypical cause
#N/AValue not availableA lookup did not find the value
#VALUE!Wrong type of valueText used in arithmetic; ranges of different sizes
#REF!Invalid referenceA referenced row, column or sheet was deleted
#DIV/0!Division by zeroThe divisor is 0 or empty
#NAME?Unknown nameMisspelled function or name; text without quotes; new function in an old version
#SPILL!Cannot spillCells in the spill range are not empty
#CALC!Calculation problemFILTER found nothing; a LAMBDA was not called
#NUM!Invalid numberImpossible maths such as SQRT(-1); IRR cannot find a solution; result too large
#NULL!Empty intersectionA space between two ranges that do not overlap, usually a missing comma or colon
#####Not an errorColumn too narrow, or a negative date/time

#DIV/0!

D3fx=B3/C3
ABCD
1RepRevenueOrdersAvg order
2Anna1840023800
3Bruno00#DIV/0!
4Chen15900121325

Bruno has no orders yet, so the average cannot be calculated.

Result: #DIV/0!

Decide what the sheet should show when the divisor is zero, and test for it explicitly: =IF(C3=0, "", B3/C3) shows an empty cell. Testing the divisor is clearer than wrapping everything in IFERROR, because it only handles the case you expect.

#N/A

Lookups such as XLOOKUP, VLOOKUP and MATCH return #N/A when the lookup value is not found. Before hiding it, check the classic causes: extra spaces, numbers stored as text versus real numbers, a typo, or a VLOOKUP range that slid down when the formula was filled (missing $). Then handle genuine misses with XLOOKUP's if_not_found argument or IFNA. The Lookup guide: VLOOKUP vs INDEX/MATCH vs XLOOKUP covers this in detail.

Tip. #N/A is not always bad. In charts, cells containing #N/A are skipped instead of being plotted as zero, which keeps a line chart from diving to the axis for months that have no data yet. =NA() produces it deliberately.

#VALUE!

  • Arithmetic with text: =B2+C2 where C2 contains n/a or 12 kg. Clean the data, or use SUM, which ignores text: =SUM(B2, C2).
  • Numbers or dates stored as text that cannot be converted, such as 15.03.2026 in a region that does not recognise it.
  • Ranges of different sizes in SUMIFS, COUNTIFS or SUMPRODUCT.
  • A hidden space: a cell that looks empty but contains a space is text. =LEN(C2) reveals it.

#REF!

#REF! appears when a formula pointed to cells that no longer exist: you deleted a column it used, pasted over a referenced range, or deleted a sheet. The formula itself now contains #REF!, for example =B2*#REF!, and Excel cannot recover the original address. Press Ctrl+Z immediately if you just caused it. Otherwise rebuild the reference by hand.

Watch out. VLOOKUP with a column number larger than the table width also returns #REF!: =VLOOKUP(A2, D2:F10, 4, FALSE) asks for the 4th column of a 3-column range.

#NAME?

  • A misspelled function: =SUMM(B2:B9). Use Formula AutoComplete to avoid typos.
  • Text without quotes: =IF(A2=Paid, 1, 0); it should be "Paid".
  • A named range that does not exist or was deleted.
  • A function newer than your Excel version, such as XLOOKUP or LET opened in Excel 2016; the formula bar shows _xlfn. in front of the name.
  • A missing colon in a range: =SUM(B2B9).

#SPILL! and #CALC!

Both belong to dynamic array Excel (Dynamic arrays: spill, FILTER, SORT, UNIQUE, SEQUENCE and #). #SPILL! means the results of a spilling formula have nowhere to go: clear the blocking cells (the warning icon offers Select Obstructing Cells), move the formula out of an Excel table, or unmerge cells. #CALC! usually means FILTER found no rows; give it the third argument, if_empty. It also appears for an uncalled LAMBDA or an empty array result.

#NUM! and #NULL!

#NUM! appears for impossible maths, such as =SQRT(-4), or when an iterative function like IRR or RATE cannot converge (give it a better guess), or when a number is too large for Excel. #NULL! is rare: the space character is Excel's intersection operator, so =SUM(B2:B9 C2:C9) asks for the overlap of two ranges that do not overlap. You meant a comma or a colon.

Auditing tools

The Formulas › Formula Auditing group contains tools for tracing problems through a workbook.

Trace Precedents and Trace Dependents

  1. Click the cell with the problem, for example a wrong total.
  2. Choose Formulas › Formula Auditing › Trace Precedents. Blue arrows point from every cell the formula uses. A red arrow means one of them contains an error; a dashed arrow with a sheet icon points to another sheet.
  3. Click it again to go one more level back, to the precedents of the precedents.
  4. Choose Trace Dependents on an input cell to see every formula that would change if you edited it. Useful before deleting anything.
  5. Choose Remove Arrows when done.
Tip. Keyboard alternatives: Ctrl+[ selects the direct precedents of the active cell and Ctrl+] its direct dependents (Windows). Double-clicking a cell with a formula, or pressing F2, highlights its precedents in colour.

Evaluate Formula

For a long formula, Formulas › Formula Auditing › Evaluate Formula lets you watch Excel calculate step by step. Each click on Evaluate replaces the underlined part with its value, so you see exactly which piece turns into the error. Step In follows a reference into the cell it points to.

A quicker trick: in the formula bar, select part of a formula and press F9. Excel shows the value of just that part. Press Esc afterwards, otherwise the calculated value replaces that part of your formula permanently.

Error Checking and the Watch Window

  • Formulas › Formula Auditing › Error Checking walks through every error on the sheet, with options to trace it or show calculation steps.
  • The green triangles in cell corners are background error checks (numbers stored as text, formulas that differ from their neighbours, formulas that omit adjacent cells). Click the warning icon for options, or configure them in File › Options › Formulas › Error checking rules.
  • Formulas › Formula Auditing › Watch Window keeps chosen cells visible while you work elsewhere. Add the key totals of a model, then change inputs on other sheets and watch the totals react.
  • Show Formulas (Ctrl + grave accent) displays all formulas at once to spot the one that is different.
Note. Trace arrows, Evaluate Formula and the Watch Window are available in Excel for Windows and Mac (on Mac some are under Formulas › Formula Auditing as icons only). Excel for the web has a smaller set of auditing tools, so for serious debugging open the file in the desktop app (Editing › Open in Desktop App).

IFERROR: use with care

IFERROR replaces any error with a value you choose: =IFERROR(B2/C2, 0). It is useful for presentation, but it hides problems you did not anticipate, such as a #REF! after someone deletes a column. Good practice: fix the cause first, then catch only the error you expect (IF on the divisor, IFNA for lookups), and reserve IFERROR for formulas where any error genuinely means the same thing. To total a range that contains errors, use =AGGREGATE(9, 6, B2:B20), which sums while ignoring error values.

Check yourself

1. Which error appears after you delete a column that a formula refers to?

2. A formula =XLOOKUP(A2, D:D, E:E) returns #NAME? on a colleague's computer. Why?

3. What does #CALC! usually mean with FILTER?

4. Which tool lets you step through a formula's calculation one part at a time?

5. =SUM(B2:B9 C2:C9) returns #NULL!. What is wrong?

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 12 KB