Sub topic 1
What an Excel Error Value Tells You
Prerequisites
Assume you can enter formulas, use cell references such as A2, and work with ranges such as A2:A10. You should also know basic functions such as SUM and AVERAGE.
Read the error before changing the formula
An Excel error value is a diagnostic result. It tells you what kind of problem occurred, but you still need to inspect the formula and its input cells.
| Error | Usual meaning |
|---|---|
| `#DIV/0!` | A formula divides by zero or an empty cell |
| `#VALUE!` | A formula receives the wrong kind of value |
| `#REF!` | A cell reference is invalid |
| `#NAME?` | A function or name is misspelled |
| `#N/A` | A lookup found no matching value |
Select the cell and open the warning menu beside it. Excel may identify the likely cause. The formula bar shows the actual formula, which is usually more useful than replacing the error with a blank.
flowchart TD
A[Formula returns an error] --> B[Read the error value]
B --> C[Inspect the formula]
C --> D[Check referenced cells]
D --> E[Fix the cause]Fixing `#DIV/0!`
Division requires a nonzero divisor. If B2 is zero or blank, =A2/B2 returns #DIV/0!.
First check whether the divisor should contain a value. If zero is valid but the result should remain blank, test the divisor explicitly:
=IF(B2=0,"",A2/B2)This prevents the error, but it can also hide missing data. Use a visible message when someone needs to investigate the input:
=IF(B2=0,"Enter a divisor",A2/B2)Fixing `#VALUE!`
#VALUE! usually means that an argument has an incompatible type. For example, =A2+B2 fails if B2 contains the text n/a. SUM ignores text in cell references, so it may be safer when text can appear in the range:
=SUM(A2,B2)Check each referenced cell for labels, punctuation, or spaces. Also check that a function receives the kind of argument it expects, such as a number rather than a date stored as text.
Numbers stored as text and hidden spaces
A value can look like 125 but still be text. Leading or trailing spaces are common after copying data from another system. Convert and clean it with:
=VALUE(TRIM(A2))TRIM removes extra spaces, and VALUE converts number-looking text into a number. Confirm the result by using it in a calculation or checking its number format.
Exercise
A2 contains 20 and B2 is blank. What causes =A2/B2 to return #DIV/0!, and how can you prevent it?
Show answer
The divisor is blank and is treated as zero. Use =IF(B2=0,"",A2/B2) or correct the missing value.