How to Fix the #NUM! Error
#NUM! means a formula was given a number it cannot work with, or its result is too large or too small for Excel to store. Square roots of negative numbers, DATEDIF with reversed dates and IRR are typical sources. Describe your calculation below and get a formula with the right safeguards.
Free, no sign-up required · 5 free generations a day
Last updated
Describe your task, get the formula
Type what you need in plain English, or pick an example below. You get the formula, a step-by-step explanation, and a worked example.
Formulas that avoid #NUM!
=IF(A2<0,"",SQRT(A2))
=DATEDIF(MIN(A2,B2),MAX(A2,B2),"d")
=IFERROR(LARGE(A2:A100,3),"")Check the input before the calculation runs: SQRT needs a number that is zero or positive, DATEDIF needs the earlier date first, and LARGE needs at least as many numbers as the position you ask for.
Examples
Days between two dates in any order
=DATEDIF(MIN(A2,B2),MAX(A2,B2),"d")DATEDIF returns #NUM! when the start date is later than the end date. MIN and MAX put the dates in the right order first.
Square root only for valid numbers
=IF(A2<0,"",SQRT(A2))A negative number has no real square root, so the formula returns a blank for those rows and the root for the rest.
Give IRR a starting guess
=IRR(B2:B12,0.1)IRR searches for the answer by trial and error and returns #NUM! if it does not settle. A guess close to the expected rate, here 10%, helps it converge.
Common mistakes and how to fix them
IRR or RATE still returns #NUM!
The cash flows must contain at least one negative and one positive value. If they do, try a different guess, such as -0.1 or 0.5.
LARGE or SMALL returns #NUM!
You asked for a position that does not exist, for example the fifth largest of three numbers. Wrap the function in IFERROR, or check COUNT of the range first.
The result is too large
Excel cannot store numbers larger than roughly 1.8 times 10 to the power of 308. This usually means a power or factorial formula has a wrong input, such as =FACT(200).
Frequently asked questions
What does #NUM! mean?
It means the formula contains an invalid numeric value: an argument outside the range the function accepts, or a result outside the range Excel can represent.
How is #NUM! different from #VALUE!?
#VALUE! is about the wrong type, such as text where a number is needed. #NUM! means the input is a number, but one the calculation cannot use.
Does Google Sheets show #NUM! for the same reasons?
Yes. SQRT of a negative number, DATEDIF with reversed dates, LARGE with too high a position and IRR that does not converge all return #NUM! in Google Sheets as well.
Don't want to write it by hand?
Describe what you need in plain English and get a ready-to-use formula in seconds.
Try the formula generator