Sub topic 11
Fixing #NUM!: invalid numeric results
This chapter assumes you can enter formulas, use cell references and ranges, and know the difference between numbers and text in cells. It also assumes you have seen the other error values in this tutorial, such as #DIV/0! and #VALUE!.
What #NUM! means
Excel shows #NUM! when a formula is valid and its arguments are numbers, but the result is not a number Excel can use. The argument types are correct, so this is not a #VALUE! problem. The values themselves are the problem.
Common causes:
- A function receives a number outside its allowed domain, such as the square root of a negative number.
- The result is too large or too small for Excel to store. Excel handles numbers up to about 1.8E+308, so
=10^400returns #NUM!. - An iterative function, such as IRR or RATE, cannot find an answer after its maximum number of tries.
- A function argument is out of range, such as asking for a negative number of items.
Example: a negative square root
SQRT accepts only zero or positive numbers. If A2 holds -9, =SQRT(A2) returns #NUM!.
The fix is to test the input first, as in the topic's example:
=IF(A2>=0,SQRT(A2),"")When A2 is negative, the formula returns an empty string and SQRT never runs. Decide what a negative value means in your data. If it should never happen, an empty result may hide a data entry mistake. In that case, return a message such as "Check input" instead of "".
If you want the size of the number regardless of sign, use =SQRT(ABS(A2)). Only do this when ignoring the sign is correct for your calculation.
Other causes and fixes
| Formula | Why it returns #NUM! | Fix |
|---|---|---|
| `=LN(0)` or `=LOG(-5)` | Logarithms are defined only for positive numbers. | Check that the input is greater than 0. |
| `=FACT(-1)` | Factorial is defined only for zero and positive numbers. | Correct the input. |
| `=10^400` | The result exceeds the largest number Excel can store. | Rescale the data, for example work in thousands. |
| `=IRR(A1:A5)` | The cash flows have no sign change, or Excel cannot converge. | Include at least one positive and one negative value, or give IRR a guess. |
| `=DATE(2026,1,1)-DATE(2027,1,1)` formatted as a date | A negative date serial number cannot be displayed as a date. | Format the cell as a number, or swap the dates. |
For iterative functions, you can supply a starting guess, for example =IRR(A1:A5,0.05). If Excel still returns #NUM!, check whether the values make financial sense. A series of only outflows has no IRR.
Diagnosing a #NUM! error
- Select the cell and read the formula in the formula bar.
- Identify which function or operator can fail on a valid number: roots, logarithms, powers, factorials, or iterative financial functions.
- Look at the input cells. Is any value negative, zero or extremely large?
- Use Evaluate Formula (Formulas tab) to step through the calculation if the formula is nested.
A negative input is the cause in most cases. Fix the input data first. Add an IF guard only when the invalid input is expected.
Exercise
Cell A2 contains -16. The formula =SQRT(A2) returns #NUM!. Write a formula that returns the text "Check input" in this case and the square root otherwise. Why is this better than IFERROR here?
Show answer
=IF(A2>=0,SQRT(A2),"Check input"). It tests the exact condition that causes the error, so other problems, such as a #REF! in A2, still show up. IFERROR would replace every error with the message and hide those other problems.
Exercise
=IRR(B2:B6) returns #NUM! and B2:B6 contains 100, 200, 300, 400, 500. What is the likely cause?
Show answer
All the values are positive. IRR needs at least one negative cash flow (an investment) and at least one positive one to find a rate.