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.
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
| Error | Meaning | Typical cause |
|---|---|---|
| #N/A | Value not available | A lookup did not find the value |
| #VALUE! | Wrong type of value | Text used in arithmetic; ranges of different sizes |
| #REF! | Invalid reference | A referenced row, column or sheet was deleted |
| #DIV/0! | Division by zero | The divisor is 0 or empty |
| #NAME? | Unknown name | Misspelled function or name; text without quotes; new function in an old version |
| #SPILL! | Cannot spill | Cells in the spill range are not empty |
| #CALC! | Calculation problem | FILTER found nothing; a LAMBDA was not called |
| #NUM! | Invalid number | Impossible maths such as SQRT(-1); IRR cannot find a solution; result too large |
| #NULL! | Empty intersection | A space between two ranges that do not overlap, usually a missing comma or colon |
| ##### | Not an error | Column too narrow, or a negative date/time |
#DIV/0!
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Rep | Revenue | Orders | Avg order |
| 2 | Anna | 18400 | 23 | 800 |
| 3 | Bruno | 0 | 0 | #DIV/0! |
| 4 | Chen | 15900 | 12 | 1325 |
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.
=NA() produces it deliberately.#VALUE!
- Arithmetic with text:
=B2+C2where C2 containsn/aor12 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.2026in 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.
=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
- Click the cell with the problem, for example a wrong total.
- 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.
- Click it again to go one more level back, to the precedents of the precedents.
- Choose Trace Dependents on an input cell to see every formula that would change if you edited it. Useful before deleting anything.
- Choose Remove Arrows when done.
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.
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?
The reference no longer exists, so Excel replaces it with #REF!.
2. A formula =XLOOKUP(A2, D:D, E:E) returns #NAME? on a colleague's computer. Why?
New functions show #NAME? in older versions.
3. What does #CALC! usually mean with FILTER?
FILTER returns #CALC! for an empty result.
4. Which tool lets you step through a formula's calculation one part at a time?
Evaluate Formula replaces parts with their values step by step.
5. =SUM(B2:B9 C2:C9) returns #NULL!. What is wrong?
The space is the intersection operator; these ranges do not intersect.