Sub topic 9
Reading #DIV/0!, #NAME?, and #VALUE!
This chapter assumes you can enter a formula that starts with =, use cell references, and know the operator precedence from earlier chapters. Here you learn what the three most common errors in arithmetic formulas mean and how to trace each one back to its cause.
What an error value tells you
When Excel cannot finish a calculation, it puts an error value in the cell instead of a number. Each error value starts with # and names a category of problem. The error does not say which cell is at fault, so you work backward from the message to the formula and the cells it refers to.
| Error | Typical cause in a simple formula |
|---|---|
| `#DIV/0!` | Dividing by zero or by an empty cell |
| `#NAME?` | Excel does not recognize a word in the formula |
| `#VALUE!` | An operand is text that Excel cannot treat as a number |
A cell that shows ##### is a different problem. The column is too narrow for the number, and widening it fixes it.
#DIV/0!: division by zero
Division by zero is undefined, so Excel returns #DIV/0!. An empty cell counts as zero in arithmetic, so it triggers the same error.
=A2/B2Suppose A2 holds 50 and B2 holds 0. The formula returns #DIV/0!. If B2 is empty, you get the same result.
This error often appears because a formula was copied down before the data was filled in. The formula is correct, and the input is missing. Check the cell used as the divisor first.
You have two ways to deal with it:
- Enter a nonzero value in the divisor cell.
- Leave the formula alone and accept that the error disappears once the data arrives.
Hiding the error with a wrapper function is possible, but it is outside this chapter. While you are learning, an error is useful because it shows that an input is missing.
#NAME?: Excel does not recognize a word
Excel reads anything in a formula that is not a number, an operator, or a valid cell reference as a name, such as a function name. If it cannot match that word to anything, it returns #NAME?.
Common causes in simple formulas:
- A missing equals sign is not the cause. Without
=, Excel treats the entry as text and shows it as typed, with no error. - A mistyped cell reference. In
=B2*C, theChas no row number, so Excel looks for a name calledC. - A reference with a stray character. In
=B2*C_2, the underscore turns the reference into an unknown name. - Text without quotation marks. In
=B2*tax,taxis read as a name.
=B2*CThe fix is to correct the reference to =B2*C2. When a formula returns #NAME?, read it from left to right and look for any word that is not a valid address, such as a letter without a row number.
#VALUE!: the wrong kind of operand
Arithmetic operators need numbers. If one operand is text that Excel cannot convert to a number, the formula returns #VALUE!.
Suppose B2 holds the text n/a and C2 holds 4.
=B2*C2This returns #VALUE! because n/a is not a number. The same happens if B2 holds a word, or a space typed into what looks like an empty cell.
Excel does convert some text automatically. If a cell holds the text "5" and you multiply it by 2, Excel treats the 5 as a number and returns 10. The error appears only when the conversion fails.
Check the cells the formula refers to. Click each one and look at the formula bar. A cell that looks blank may contain a space, and a number that is left-aligned may be stored as text.
A diagnosis routine
Use the same steps for any of the three errors.
- Select the cell that shows the error and read the formula in the formula bar.
- Match the error to its usual cause from the table above.
- Click each cell the formula refers to and check its contents.
- Fix the input or the formula, then press Enter.
Errors spread
If a formula refers to a cell that already shows an error, the result is usually the same error. A total built on a cell showing #DIV/0! will also show #DIV/0!. Fix the first cell in the chain, and the dependent cells recover on their own.
=A2/B2If this formula is in C2 and a later cell uses =C2*2, both cells show #DIV/0! until B2 holds a nonzero value.
Practice
Exercise
Cell B2 contains the text "pending" and C2 contains 12. What does =B2*C2 return, and why?
Show answer
It returns #VALUE!, because "pending" is text that Excel cannot convert to a number, and the * operator needs numbers.
Exercise
You type =B2*rate in cell D2, and the cell shows #NAME?. What is the most likely cause?
Show answer
Excel reads "rate" as a name, but no such name exists. Replace it with a cell reference, such as $F$1, or define the name.
Exercise
A formula =A2/B2 is copied down 20 rows, and rows 15 to 20 show #DIV/0! while B15:B20 are empty. Does the formula need changing?
Show answer
No. The formula is correct. Empty cells count as zero, so the error appears until values are entered in B15:B20.