Excel formula errors: #DIV/0!, #N/A, #VALUE!, #REF!, #NAME? and how to fix them
What #DIV/0!, #N/A, #VALUE!, #REF!, #NAME?, #NUM!, #SPILL! and #### mean in Excel, what causes them and how to fix them with IFERROR and IFNA.
When a formula can’t produce a result, Excel puts an error value starting with # in the cell. It doesn’t mean “Excel is broken” — on the contrary, Excel is telling you exactly what it didn’t like. Every error has its own meaning, and once you can read them, you’ll find the cause in seconds.
Importantly, errors propagate. One #N/A flows into every formula that depends on it — the total, the average, the report. So always look for the first source of the error.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Error | In short | Typical cause | |
| 2 | #DIV/0! | division by zero | divisor cell is 0 or blank | |
| 3 | #N/A | value not found | VLOOKUP found no match | |
| 4 | #VALUE! | wrong data type | a number added to text | |
| 5 | #REF! | reference lost | a row or column was deleted | |
| 6 | #NAME? | name not recognized | typo in a function name | |
| 7 | #NUM! | invalid number | square root of a negative | |
| 8 | #SPILL! | result can’t fit | a filled cell is in the way | |
| 9 |
#DIV/0! — division by zero
Appears when the divisor is 0 or a blank cell (Excel treats blank as zero). Most often it shows up in rows that aren’t filled in yet: the average receipt of a branch that has no receipts yet.
Fix: check the divisor first — =ЕСЛИ(C2=0;"—";B2/C2). Or shorter: =ЕСЛИОШИБКА(B2/C2;"—").
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Branch | Sales | Receipts | Avg receipt | Fixed | |
| 2 | Chilanzar | 12 500 000 | 250 | 50 000 | 50 000 | |
| 3 | Yunusabad | 9 800 000 | 196 | 50 000 | 50 000 | |
| 4 | Sergeli | 0 | 0 | #DIV/0!1 | — | |
| 5 |
#N/A — value not available
Appears when VLOOKUP, XLOOKUP or MATCH can’t find what they look for. Three main causes:
- The value really isn’t in the lookup table.
- An invisible extra space: “Milk ” and “Milk” are different text to Excel.
- Number vs text: 125 is a number in one table and “125” is text in the other — they are not equal.
Fix: strip spaces with TRIM, make the types match. If the value may genuinely be missing, use =ЕСНД(ВПР(...);"Not found"). XLOOKUP has a dedicated argument for this: =ПРОСМОТРX(A2;E:E;F:F;"Not found").
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Product | Price | With TRIM | Product | Price | ||
| 2 | Bread | 4 000 | 4 000 | Bread | 4 000 | ||
| 3 | Milk 1 | #N/A | 12 000 | Milk | 12 000 | ||
| 4 | Yogurt2 | #N/A | Not found | Eggs | 1 500 | ||
| 5 |
#VALUE! — wrong type of value
Appears when a formula expects a number but meets text: a cell with “5 kg” or “12 000 UZS”, a date that became text, an invisible character.
An interesting difference: the + operator returns #VALUE! when it meets text, but SUM silently skips text. =B2+B3+B4 shows an error, while =СУММ(B2:B4) shows no error but returns a wrong total — which is even more dangerous.
Fix: move units into a separate column or the header (“Weight, kg”) so the cell holds only a number.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Product | Weight | Price/kg | Total | |
| 2 | Apples | 5 kg1 | 15 000 | #VALUE! | |
| 3 | Pears | 3 | 22 000 | 66 000 | |
| 4 | Grapes | 4 | 18 000 | 72 000 | |
| 5 | Total | #VALUE!2 | |||
| 6 |
#REF! — the reference is gone
The cell the formula pointed to no longer exists: a row, column or sheet was deleted. The formula turns into =B2*#REF! and won’t heal by itself.
- Noticed right away? Undo the deletion with Ctrl + Z.
- Formulas like
=B2+B3+B4return#REF!when a row is deleted, while=СУММ(B2:B4)just shrinks the range and keeps working. Range-based functions are safer. - A formula copied upward from row 1 also gives
#REF!: there are no rows above.
#NAME? — Excel doesn’t recognize a name
- A typo in the function name:
=SUMM(B2:B5),=VLOKUP(...). - Text without quotes:
=ЕСЛИ(B2>=60;Pass;Fail)— Excel looks for “Pass” as a name. - A missing colon in a range:
=СУММ(B2B5). - A named range that doesn’t exist:
=СУММ(Sales), but the name “Sales” was never created. - A new function in an old Excel: XLOOKUP, FILTER and UNIQUE don’t exist in Excel 2016.
To avoid it, pick functions from the list with Tab — Excel spells the name correctly for you.
#NUM!, #SPILL!, #NULL! and ####
- #NUM! — mathematically impossible:
=КОРЕНЬ(-4), a number that is too large (=10^400), IRR or RATE couldn’t find a solution. - #SPILL! — Excel 365 dynamic array functions (FILTER, UNIQUE, SORT, SEQUENCE) “spill” results into neighboring cells. If even one cell in the way is filled, you get
#SPILL!. Clear the blocking cell. - #NULL! — a space instead of a comma or colon between ranges:
=СУММ(B2 B5). - #CALC! — in Excel 365, for example when FILTER finds no rows. The third argument solves it:
=ФИЛЬТР(A2:C20;C2:C20>100;"None"). - #### — not an error at all! The column is too narrow for the number. Double-click the column border. If #### remains after widening, the cell holds a negative date or time.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | City | Unique cities | ||
| 2 | Tashkent | #SPILL! | ||
| 3 | Samarkand | |||
| 4 | Tashkent | note1 | ||
| 5 | Bukhara | |||
| 6 | Samarkand | |||
| 7 |
Finding and fixing an error fast
1
Select the error cell — a yellow ⚠ icon appears next to it. Click it to open a menu with the error type and Show Calculation Steps...: Excel evaluates the formula step by step and shows where it “broke”.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Branch | Sales | Receipts | Avg receipt | |
| 2 | Chilanzar | 12 500 000 | 250 | 50 000 | |
| 3 | Yunusabad | 9 800 000 | 196 | 50 000 | |
| 4 | Sergeli | 0 | 0 | #DIV/0! | |
| 5 |
2
Press F2 — every reference in the formula gets a colored border. The borders show you which cell is causing the problem.
3
If the error came from another formula, walk up the chain: Trace Precedents on the Формулы tab draws arrows to the cells the formula depends on. Fix the first cell with an error and the rest disappear on their own.
4
To find every error on a big sheet at once: Главная → Найти и выделить → Go To Special....
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Branch | Sales | Receipts | Avg receipt | |
| 2 | Chilanzar | 12 500 000 | 250 | 50 000 | |
| 3 | Yunusabad | 9 800 000 | 196 | 50 000 | |
| 4 | Sergeli | 0 | 0 | #DIV/0! | |
| 5 |
5
In the dialog choose Formulas and leave only Errors checked. After OK, every formula with an error on the sheet is selected — easy to review or highlight.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Branch | Sales | Receipts | Avg receipt | |
| 2 | Chilanzar | 12 500 000 | 250 | 50 000 | |
| 3 | Yunusabad | 9 800 000 | 196 | 50 000 | |
| 4 | Sergeli | 0 | 0 | #DIV/0! | |
| 5 |
IFERROR and IFNA — replacing an error with a clear answer
=ЕСЛИОШИБКА(value; value_if_error)— if the formula returns any error, the second argument is returned instead:=ЕСЛИОШИБКА(B2/C2;0).=ЕСНД(value; value_if_na)— catches only#N/Aand lets other errors show. That is exactly what lookup functions need:=ЕСНД(ВПР(A2;$E$2:$F$50;2;ЛОЖЬ);"Not found").
For the second argument use 0, empty text "" or a note (“Not found”) — whatever reads best in the report.
Example
Formula:
=IFERROR(A2/B2,0)→ result: 0
Pro level: working with a column that contains errors
- Sum around errors. One
#N/Ain a column makes=СУММ(D2:D100)return an error too.=AGGREGATE(9;6;D2:D100)adds up while skipping errors (9 = SUM, 6 = ignore errors). Use 1 for AVERAGE, 4 for MAX, 5 for MIN. - Count the errors:
=СУММПРОИЗВ(--ЕОШИБКА(D2:D100))tells you how many errors a column has. Keep it as a check cell before you send a report. - Count only #N/A:
=СУММПРОИЗВ(--ISNA(D2:D100))— how many products are missing from the lookup table. - #N/A on purpose: to stop a chart from plotting 0 for a missing point, put
=NA()in the cell — a line chart skips that point. - The green triangle is a warning, not an error (number stored as text, a formula unlike its neighbors). Choose which ones appear under File → Options → Formulas → Error checking rules.
Try it in the simulator
Calculate the average receipt safely in D2: =ЕСЛИ(C2=0;0;B2/C2) and fill it down to D4. Then write the same with IFERROR in E2: =ЕСЛИОШИБКА(B2/C2;"—") and compare the results.
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Branch | Sales | Receipts | Avg (IF) | Avg (IFERROR) | |||||||||||||||||||
| 2 | Chilanzar | 12500000 | 250 | |||||||||||||||||||||
| 3 | Yunusabad | 9800000 | 196 | |||||||||||||||||||||
| 4 | Sergeli | 0 | 0 | |||||||||||||||||||||
| 5 | ||||||||||||||||||||||||
| 6 | ||||||||||||||||||||||||
| 7 | ||||||||||||||||||||||||
| 8 | ||||||||||||||||||||||||
| 9 | ||||||||||||||||||||||||
| 10 |
Has ExcelLab been useful?
Support the project and help us release new lessons and exercises.