Sub topic 2
Common causes of #DIV/0!, #N/A, #VALUE!, #REF!, #NAME?, #NUM! and #NULL!
This chapter assumes you can enter and copy formulas, understand relative and absolute references, and have used IF and VLOOKUP. Knowing why each error appears tells you whether to fix the formula, fix the data, or handle the error with IFERROR or IFNA.
Reading the error as a diagnosis
Each error value names a category of failure. The error is a message from Excel about what went wrong, so read it before you decide how to handle it.
| Error | Meaning in short | Typical cause |
|---|---|---|
| #DIV/0! | Division by zero | The divisor is 0 or an empty cell |
| #N/A | Value not available | A lookup finds no match |
| #VALUE! | Wrong type of value | Text where a number is required |
| #REF! | Invalid reference | A referenced cell or sheet was deleted |
| #NAME? | Unrecognized name | A typo in a function or name |
| #NUM! | Invalid number | A calculation has no valid numeric result |
| #NULL! | Empty intersection | A wrong range operator |
#DIV/0!
This error appears when a formula divides by zero or by an empty cell. Averages can trigger it too, because AVERAGE divides by the count of numbers.
=A2/B2If B2 is 0 or blank, the result is #DIV/0!. It is common when you copy a formula down to rows that have no data yet. The fix is usually a check on the divisor, which a later chapter covers.
#N/A
This error means a value is not available. Lookup functions such as VLOOKUP, HLOOKUP, MATCH and XLOOKUP (without a fallback) return it when the lookup value is not found.
=VLOOKUP(E2, $A$2:$B$100, 2, FALSE)Common reasons for a failed match:
- The key really is missing from the table.
- The key has extra spaces, such as
"AB-100 "against"AB-100". - One side stores the key as text and the other as a number.
- The lookup range does not cover the row you need.
#N/A is the one error that often means "no result exists", which is why IFNA is built for it.
#VALUE!
Excel returns #VALUE! when an argument has the wrong type. The usual case is arithmetic on text.
=A2+B2If A2 holds the text "12 units", the formula returns #VALUE!. Other causes include a range passed where a single value is expected, and dates stored as text. A cell that looks blank but holds a space also counts as text.
#REF!
This error means a reference is no longer valid. It most often appears after you delete a row, column or sheet that a formula used. It also appears when a copied formula points outside the sheet, or when VLOOKUP's column index is larger than the table has columns.
=VLOOKUP(E2, $A$2:$B$100, 3, FALSE)The table has two columns, so index 3 returns #REF!. A deleted reference shows up inside the formula as #REF!, so you can see where it broke.
#NAME?
Excel does not recognize some text in the formula. Typical causes:
- A misspelled function, such as
=VLOKUP(...). - A misspelled or deleted named range.
- Text in a formula without quotation marks.
- A function your Excel version does not support, such as XLOOKUP in an older version.
#NUM! and #NULL!
#NUM! means a calculation cannot produce a valid number. Examples are =SQRT(-1), a result too large or too small for Excel to store, or an iterative function such as IRR that cannot find a solution.
#NULL! appears when you use the intersection operator, which is a space, between two ranges that do not overlap. Most often it is a typo.
=SUM(A1:A5 C1:C5)The author meant a comma or a colon. The space asks for the cells the two ranges share, and there are none.
Which errors you should hide
The causes above sort into two groups. The sorting guides the rest of this tutorial.
#N/A from a missing key and #DIV/0! from an empty row are often expected. #NAME?, #REF! and #NULL! almost always mean the formula is broken. If you wrap those in IFERROR, the problem stays in your workbook but you can no longer see it.
Finding the cause
- Click the cell and read the formula in the formula bar.
- Use Formulas > Evaluate Formula to step through the calculation.
- Check the inputs for text, spaces and blanks.
- Use the green triangle in the cell's corner to open the error-checking menu.
Exercise
A VLOOKUP returns #REF! on every row. The formula is =VLOOKUP(E2, $A$2:$B$100, 3, FALSE). What is the cause, and would IFNA hide it?
Show answer
The table range A2:B100 has two columns, but the column index is 3, so Excel cannot return a value and gives #REF!. IFNA would not hide it, because IFNA only catches #N/A. The fix is to change the index to 2.
Exercise
A cell contains =SUM(A1:A5 C1:C5) and returns #NULL!. What did the author most likely intend, and what is the fix?
Show answer
The author most likely meant to add both ranges. Replace the space with a comma: =SUM(A1:A5, C1:C5).