Spreadsheet error

How to fix the #NUM! error

TL;DR

#NUM! means a formula received a numerically invalid argument — negative number under a square root, too-large result, or iterative function that did not converge.

What it means

The #NUM! error is returned when a formula has a problem with numbers: the value is out of the legal range for the function, or the function cannot compute a result (e.g., IRR that does not converge).

Common causes

How to fix it

1.Guard the domain

  1. For SQRT: =IF(A2<0, 0, SQRT(A2)) or =SQRT(ABS(A2)) if absolute value is fine.
  2. For LOG: =IF(A2<=0, "", LOG(A2)).

2.Provide a guess for IRR/RATE

  1. IRR accepts a guess as a second argument.
  2. =IRR(values, 0.1) — starts iteration closer to the expected answer.
  3. Or use XIRR which handles irregular intervals better.

3.Use IFERROR as a safety net

  1. =IFERROR(IRR(values), "No solution")
  2. But prefer explicit domain guards above — they tell you which case failed.

Example

Broken=SQRT(A2)Fixed=IF(A2<0, 0, SQRT(A2))

When A2 is negative, SQRT returns #NUM!. Guard by returning 0 (or ABS) for negatives.

Prevention

Related errors

#DIV/0!#VALUE!#CALC!

Let FormulaPad debug it for you

Paste your broken formula and the error message — get a diff and an explanation in seconds.

Debug a formula