Sub topic 1
What Excel error values tell you
An Excel error value is a result that tells you a formula could not produce a normal answer. Each error type points to a different kind of problem. If you can read the error, you can fix the cause. If you hide it too early, you lose that information. This chapter covers how to read errors. Later chapters cover how to handle them with IFERROR and IFNA.
Prerequisites
This chapter assumes you can do the following:
- Enter and copy formulas in Excel.
- Tell relative references (
A2) from absolute references ($A$2). - Use IF and a lookup function such as VLOOKUP at a basic level.
Errors are results, not failures of Excel
When a formula cannot return a number, text, or logical value, Excel returns an error value. Every error value starts with #. The error is stored in the cell like any other result. Any formula that refers to that cell receives the error too, so one bad cell can spread through a whole sheet.
This spreading is the first thing to understand. If C2 shows #DIV/0! and D2 is =C2*2, then D2 also shows #DIV/0!. The error you see in a final total may have started many cells earlier.
The seven error values
The table lists each error with its usual cause. Treat the cause as the first thing to check, not as the only possibility.
| Error | Typical cause | Example |
|---|---|---|
| `#DIV/0!` | Dividing by zero or by an empty cell | `=A2/B2` when `B2` is 0 or blank |
| `#N/A` | A lookup value was not found | `=VLOOKUP(E2, $A$2:$B$100, 2, FALSE)` with no match |
| `#VALUE!` | A wrong type of value, such as text where a number is needed | `=A2+B2` when `B2` holds the text "n/a" |
| `#REF!` | A reference points to a cell that no longer exists | A formula refers to a column that was deleted |
| `#NAME?` | Excel does not recognize a name | A misspelled function such as `=SUMM(A2:A9)` |
| `#NUM!` | A number is invalid for the operation | `=SQRT(-4)` |
| `#NULL!` | An intersection of two ranges that do not overlap | `=SUM(A2:A5 C2:C5)` with a space instead of a comma |
Reading the errors by group
The errors fall into three groups. Knowing the group tells you where to look.
Data problems
#DIV/0!, #N/A, and #VALUE! usually come from the data a formula reads. A blank divisor, a missing key, or a stray text entry causes them. The formula is often correct. The input is the issue.
#N/A deserves special attention. It is the only error that often means "nothing wrong, the item is simply not in the list." That is why a later chapter treats it separately from the others.
Structure problems
#REF! and #NULL! point to how the sheet or formula is built. #REF! appears after you delete rows, columns, or sheets that a formula used. The formula text itself changes to show #REF! inside it, as in =SUM(A2:#REF!). Fixing it means repairing the reference. Hiding it does not help.
Syntax and math problems
#NAME? and #NUM! point to the formula itself. #NAME? means a typo, a missing quotation mark around text, or a function your Excel version does not have. #NUM! means the math cannot work, for example a negative number inside a square root.
A worked example
Suppose a sheet holds prices in column A and quantities in column B. Column C holds unit cost per item, calculated as =A2/B2.
- Row 2 has A2 = 50 and B2 = 5. The formula returns 10.
- Row 3 has B3 left blank. The formula returns
#DIV/0!, because a blank counts as 0. - Row 4 has B4 containing the text "five". The formula returns
#VALUE!, because text cannot be divided into a number. - A total in
C10of=SUM(C2:C4)now returns#DIV/0!, because SUM passes on the first error it meets in the range.
The total shows the error, but the cause is two rows above. To find it, select the cell, open the Formulas tab, and use Error Checking or Evaluate Formula. These tools show which input produced the error.
Why this matters before using IFERROR
An error value is information. #REF! says the structure is broken. #NAME? says there is a typo. #N/A says a key is missing. Wrapping every formula in an error handler removes all of these messages at once. Later chapters show how to handle errors that are expected, such as a missing lookup match, while keeping the ones that signal real mistakes.
Exercise
A cell shows #REF! after a colleague deleted column B. Is this a data problem, a structure problem, or a syntax problem, and should you hide it with a fallback value?
Show answer
It is a structure problem. The formula refers to a column that no longer exists. You should repair the reference, for example by restoring the column or editing the formula, because a fallback value would hide a broken formula.
Exercise
=A2/B2 returns #DIV/0! in C5, and =SUM(C2:C9) also returns #DIV/0!. Why does the total show an error, and where do you look first?
Show answer
SUM returns the first error it finds in its range, so the error from C5 passes into the total. Look at C5 and its inputs, A5 and B5, to find the zero or blank divisor.