Fix the #NUM! Error
A formula that works on most rows returns #NUM! on a few — the math is valid in general, but something about those specific inputs makes it impossible.
Excel & Google Sheets
This formula works in both Excel and Google Sheets.
How it works
#NUM! means the math itself broke: the formula asked for a number that can't exist or can't be represented. The classic causes are taking the square root or logarithm of a negative number, a result beyond the spreadsheet's limits (=1000^1000 overflows), an iterative function like IRR or RATE failing to converge on an answer, or date arithmetic that runs backwards — DATEDIF with an end date before the start date returns #NUM!. So the fix starts with the input, not the formula: find which value is negative, swapped, or out of range and correct it at the source. Wrap in IFERROR only after you've confirmed the bad inputs are legitimate — for example, negative variances where a square root genuinely doesn't apply — because a blanket IFERROR will also hide the rows you'd want to catch.
When to use it
Diagnose #NUM! whenever root, log, or power formulas hit negative or huge values, when IRR or RATE won't converge, or when date subtraction has start and end reversed.
Common mistakes
Got a file full of these?
Open it in your browser — every error cell gets highlighted with its fix. Nothing is uploaded.
Did this formula help?
Engine-verified against the sample data aboveLast reviewed 2026-07-08