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, that you understand relative and absolute references (A2 versus $A$2), and that you have used IF and VLOOKUP. Later chapters wrap these errors in IFERROR and IFNA. First you need to know what produces each error, because the right fix depends on the cause.
Why the cause matters
Every Excel error value is a message about one specific kind of failure. If you hide an error without reading it, you lose that message. A formula that returns #N/A because a product code is missing has a different problem from one that returns #N/A because you reversed two lookup arguments. Hiding both with the same wrapper makes the second problem invisible.
Excel has seven classic error values. Each one begins with # and, except #N/A, ends with ! or ?.
| Error | Short meaning | Typical trigger |
|---|---|---|
| #DIV/0! | Division by zero | Divisor is 0 or an empty cell |
| #N/A | Value not available | Lookup finds no match |
| #VALUE! | Wrong type of argument | Text used where a number is needed |
| #REF! | Invalid reference | A referenced cell, row, column or sheet was deleted |
| #NAME? | Unrecognized name | Misspelled function, unquoted text, unknown name |
| #NUM! | Invalid number | Impossible math or a result that is too large |
| #NULL! | Empty intersection | Two ranges separated by a space do not overlap |
#DIV/0!
Excel returns #DIV/0! when a formula divides by zero. An empty cell counts as zero in arithmetic, so a blank divisor causes this error too.
=A2/B2If B2 holds 0 or nothing, the result is #DIV/0!. Common situations:
- A rate or percentage column is filled down before the denominator data has been entered.
=AVERAGE(C2:C10)returns#DIV/0!when no cell in the range contains a number.AVERAGEignores text and blanks, so it ends up dividing by a count of zero.=MOD(10, 0)also fails, because it divides internally.
This error often reflects missing data and not a mistake in the formula. Rows that are not yet complete are the usual source.
#N/A
#N/A means "not available". Lookup functions return it when they cannot find what you asked for. It is the error you will see most often with VLOOKUP, HLOOKUP, MATCH, INDEX/MATCH and XLOOKUP (when no if_not_found argument is given).
=VLOOKUP(E2, $A$2:$B$100, 2, FALSE)Several different situations lead to #N/A here:
- The value is truly missing. The code in
E2does not appear in column A. This is the legitimate case. - Hidden spaces.
"A100 "with a trailing space does not match"A100". Imported data often has these. - Text versus number. The lookup value is the number
1001, but the table stores"1001"as text, or the reverse. They look identical on screen and do not match. - The lookup column is not first.
VLOOKUPalways searches the leftmost column of the table range. If the key sits in column B and your range starts at column A, no match is found. - A shifted range. An unlocked range such as
A2:B100drifts down when you copy the formula. Rows near the bottom then search a range that no longer holds the key. This is why the lookup range uses$A$2:$B$100in the example above.
The same value can also be created on purpose. The NA() function returns #N/A, and chart authors use it so Excel skips a point instead of plotting a zero.
=IF(B2="", NA(), B2)Because #N/A has both a legitimate meaning ("no match") and several accidental causes, it is the error that most rewards careful handling. Later chapters return to this.
#VALUE!
#VALUE! means a function or operator received the wrong type of argument. The formula's syntax is valid, but the data is not.
=A2+B2If A2 contains the text "n/a" or "12 units", the addition fails with #VALUE!. Other typical causes:
- Numbers stored as text with extra characters, such as a leading apostrophe, a currency symbol typed as text, or a non-breaking space from a web page.
- A date stored as text, used in date arithmetic.
="2026-13-45"+1fails because Excel cannot read it as a date. - A range supplied where a single value is required. In older Excel versions without dynamic arrays,
=A2:A5+1entered normally can return#VALUE!. - A bad argument value in a function.
=VLOOKUP(E2, A2:B100, 0, FALSE)returns#VALUE!because the column index must be at least 1.
Note that =SUM(A2:B2) does not fail when A2 holds text. SUM skips text in ranges, while the + operator does not. If a total works with SUM but fails with +, check for text.
#REF!
#REF! means a reference is no longer valid. The formula points at something that does not exist.
The most common cause is deleting what the formula referred to. Suppose D2 contains =B2*C2. If you delete column C, Excel cannot keep that reference, and the formula becomes:
=B2*#REF!Once the #REF! text is part of the formula, it stays there. Undo the deletion right away if you notice it. Saving and closing does not repair it.
Other causes:
- Copying or cutting and pasting over a cell that other formulas depend on.
- A relative reference that runs off the sheet. Copying
=A1into row 1 one column to the left, in a way that points above row 1 or left of column A, fails. - A column index that is too large.
=VLOOKUP(E2, $A$2:$B$100, 3, FALSE)searches a two-column range for a third column, so it returns#REF!. A column index of 0 or less gives#VALUE!, as shown earlier. - A reference to a closed or missing workbook or sheet. Deleting a sheet leaves
#REF!in every formula that used it.
#NAME?
#NAME? means Excel does not recognize a word in the formula. It could not match the word to a function, named range, or other defined item.
=SUMM(A2:A10)Here SUMM is a misspelled function name. Other causes:
- Text without quotes.
=IF(A2>5, High, "Low")treatsHighas a name that does not exist. The correct form is"High". - A range missing its colon.
=SUM(A2A10)readsA2A10as a name. - An undefined or deleted named range. If you wrote
=Price*Qtyand removed theQtyname, the formula fails. - A function the version does not support.
XLOOKUPandIFNAbehave this way in versions that lack them.IFNAappeared in Excel 2013, andXLOOKUPin Excel 2021 and Microsoft 365. Opening such a file in Excel 2010 or Excel 2016 shows#NAME?. - Curly quotes. Text pasted from a document or email may contain typographic quotes that Excel does not treat as quotation marks.
#NAME? is almost always a typing or compatibility problem. Click the cell and read the formula for the unfamiliar word.
#NUM!
#NUM! means the formula involves a number that is not valid or cannot be computed.
=SQRT(-4)A square root of a negative number has no real result. Other examples:
=LN(0)or=LOG(-1), since logarithms need positive inputs.=10^1000, because the result exceeds the largest number Excel can store (about 1.8 × 10^308 in modern Excel's documented limit of 9.99999999999999E+307).=DATE(-1, 1, 1), since a negative year is out of range.- Iterative finance functions such as
IRRandRATEthat cannot converge on an answer within 20 or so tries. Supplying a better starting guess often helps.
Look at the input values first. A #NUM! often follows a negative or zero value that someone assumed would always be positive.
#NULL!
#NULL! is the rarest error. In Excel's formula syntax, a space between two references is the intersection operator. It returns the cells the two ranges have in common. If the ranges share no cells, the result is #NULL!.
=SUM(A1:A5 C1:C5)Columns A and C never overlap, so the result is #NULL!. In almost every real case the writer meant one of these instead:
=SUM(A1:A5, C1:C5)
=SUM(A1:C5)The first uses a comma to add two separate ranges. The second uses a colon for one continuous range. Typing a space where a comma or colon belongs is the usual cause.
Reading an error with ERROR.TYPE
When you inherit a sheet full of errors, ERROR.TYPE names each one as a number. It returns 1 through 7 for the seven errors above, in the order #NULL!, #DIV/0!, #VALUE!, #REF!, #NAME?, #NUM!, #N/A. If the cell holds no error, ERROR.TYPE returns #N/A.
You can turn that into a readable label:
=IFERROR(CHOOSE(ERROR.TYPE(C2), "Null", "Div by zero", "Value", "Ref", "Name", "Num", "N/A"), "No error")The inner CHOOSE picks a label by number. When C2 holds a normal value, ERROR.TYPE itself returns #N/A, and IFERROR converts that into "No error". This is a rare case where IFERROR is used to read an error and not to hide one.
How errors spread
An error in one cell passes to every formula that uses it. If C2 is #N/A, then =C2*2 is #N/A, and a total that adds C2 is #N/A too. Most aggregate functions such as SUM and AVERAGE fail when any cell in their range holds an error.
The following diagram shows the spread, and why one bad input can break a whole report.
Because of this spread, you need to find the first error in the chain and fix it there. Use Formulas > Error Checking or Trace Precedents to move toward the source.
Look-alikes that are not errors
Two things resemble errors but are not:
#####means the column is too narrow to display the number or date. Widening the column fixes it.#SPILL!and#CALC!belong to dynamic-array Excel.#SPILL!appears when a formula's result needs more cells than are free, and#CALC!when an array calculation cannot finish. They are real error values, but they are outside the seven covered here.
Quick diagnosis checklist
When a cell shows an error, work through these steps:
- Read the exact error text, because each one narrows the cause.
- Click the cell and check the formula bar for
#REF!or a misspelled word. - Use Formulas > Evaluate Formula to step through the calculation.
- Check the inputs with
ISNUMBER,LENandTRIM, which reveal text-numbers and hidden spaces. - Fix the first cell in the chain, not the last.
=ISNUMBER(E2)=LEN(E2)=LEN(TRIM(E2))The first returns FALSE when E2 holds text and not a number. The second returns FALSE when E2 has extra leading, trailing or repeated spaces.
Exercise
A cell contains =VLOOKUP(E2, $A$2:$B$100, 3, FALSE). Which error does it return, and why? What would the error be if the column index were 0?
Show answer
It returns #REF! because the range $A$2:$B$100 has only two columns, so column 3 does not exist. With a column index of 0 (or any value below 1), VLOOKUP returns #VALUE! instead.
Exercise
=SUM(B2:B6 D2:D6) shows #NULL!. What caused it, and how would you rewrite the formula to add both ranges?
Show answer
The space between the ranges is the intersection operator, and columns B and D share no cells, so the result is empty and Excel shows #NULL!. Use a comma to add two separate ranges: =SUM(B2:B6, D2:D6).
Exercise
=A2+B2 returns #VALUE! while =SUM(A2:B2) returns a number. B2 holds a number. What is the likely content of A2, and why do the two formulas differ?
Show answer
A2 likely holds text, such as "n/a" or a number stored as text. The + operator cannot add text, so it returns #VALUE!. SUM skips text found in ranges, so it totals only B2 and reports no error.