The #NUM! error means a formula received a number that the calculation can’t use, or it produced a result Excel can’t display. The cause is usually a number outside the range that a particular function accepts. The fix depends on the function, so check what it expects.
Math that has no answer
Some functions aren’t defined for certain numbers:
SQRTreturns#NUM!for a negative number, such as=SQRT(-9).LNandLOGreturn#NUM!for zero or negative numbers.
You can guard against this with a test. =IF(A2<0,"",SQRT(A2)) returns a blank for negative values and the square root otherwise. The guide on how to use if function in excel covers the structure of that kind of test.
A result that is too large or too small
Excel can only store numbers within a certain range, so a calculation that grows past that range can return #NUM!. Powers are a common example. A formula such as =10^400 produces a number too large to store. Check the scale of the numbers in the calculation, and make sure the inputs are in the units you expect.
Finance functions that don’t converge
IRR, RATE and XIRR work by trying repeated guesses until they reach an answer. If they can’t get there within the number of tries they allow, they return #NUM!. Common reasons include:
- No mix of signs. IRR usually needs at least one positive and one negative cash flow.
- A guess far from the answer. You can add a guess as the second argument. For example,
=IRR(B2:B6,0.1)starts the search at 10%. - Reversed signs. Money you receive should be positive, and money you pay should be negative. Mixing these up can make a solution impossible to find.
A position outside the range
LARGE and SMALL return #NUM! when the position you ask for is bigger than the number of values. For example, =LARGE(A2:A5,5) returns #NUM! when the range holds only four numbers. Use COUNT to see how many numbers the range holds, and keep the position within that count.
Find the bad input
- Click the cell and read the formula.
- Use Evaluate Formula to see the result of each part.
- Check the inputs with ISNUMBER, and look for negative values, zeros, and values too large for the function.
Google Sheets
Google Sheets returns #NUM! for invalid numbers in math functions too. The same checks apply there: confirm the inputs are numbers, check the signs, and use the same guard formulas.