An Excel #NUM! error occurs when a formula encounters an invalid numeric value or hits an impossible mathematical calculation. This error is prevalent in financial functions (such as IRR, XIRR, and RATE) and iterative mathematical operations. It signifies that the calculation either exceeded Excel’s physical numeric limits, attempted an illegal operation (like finding the square root of a negative number), or failed to converge on a stable answer within its built-in iteration threshold.
Fast Fix
For financial functions like
IRRorXIRR, confirm that your cash flow range contains at least one negative number (outflow) and at least one positive number (inflow). If the cash flows are valid but#NUM!persists, provide a starting guess in the formula’s final argument (e.g.,=IRR(A2:A10, 0.15)).
Diagnostic Snapshot
| Indicator | Detail |
|---|---|
| Primary Error | #NUM! |
| Common Functions | IRR, XIRR, RATE, YIELD, SQRT, LARGE, SEQUENCE |
| Primary Cause 1 (Financial) | No sign change in cash flows, or algorithm fails to converge within 20 iterations |
| Primary Cause 2 (Math/Limits) | Result exceeds 1.7976931348623158E+308 or attempts invalid operations (e.g., SQRT(-x)) |
| Primary Cause 3 (Bounds) | Requesting a position outside range dimensions (e.g., LARGE(range, 0) or k > total items) |
The Mechanics: Why Financial Formulas Trigger #NUM!
Financial functions such as IRR (Internal Rate of Return), XIRR, and RATE do not calculate answers through a simple direct algebraic formula. Instead, they use an iterative numerical algorithm (specifically, the Newton-Raphson method) to search for a discount rate that makes the Net Present Value (NPV) of cash flows equal zero.
Iterative Financial Calculation Loop:
Iteration 01: Test rate = 10.0% ──> NPV = $45,000 (Too high)
Iteration 02: Test rate = 18.0% ──> NPV = -$12,000 (Too low)
Iteration 03: Test rate = 15.2% ──> NPV = $1,200 (Approaching zero...)
...
Iteration 20: Test rate = ??? ──> NPV not within 0.00001% tolerance.
Result: STOP calculation ──> Output #NUM!
Excel tests up to 20 iterations by default to find a result within a tolerance of 0.00001% (0.0000001). If the cash flow numbers oscillate wildly, or if the rate of return cannot mathematically resolve to zero, the engine stops and displays #NUM!.
Troubleshooting Common #NUM! Scenarios
1. Cash Flow Sign Check in IRR and XIRR
To calculate an internal rate of return, money must flow in both directions:
- There must be at least one cash outflow (negative number, representing initial investment or expense).
- There must be at least one cash inflow (positive number, representing revenues or returns).
If an analyst enters all numbers as positive values (e.g., listing investments as positive figures), IRR and XIRR cannot calculate a discount rate. The formula immediately evaluates to #NUM!.
Resolution:
Check the cash flow column. Ensure the initial outlay is explicitly entered as a negative value:A2: -100000 (Year 0 Investment)A3: 25000 (Year 1 Return)A4: 40000 (Year 2 Return)
2. Supplying the Optional [guess] Parameter
When cash flows alternate between positive and negative values multiple times across different years (non-conventional cash flows), multiple internal rates of return can mathematically exist. In these cases, Excel’s default starting estimate (10%) may send the algorithm down a divergent path where it exhausts its 20 iterations without finding a root.
Resolution:
Supply an explicit [guess] in the final argument to guide the algorithm near the expected rate:=IRR(A2:A10, 0.25) (Tells Excel to start searching from 25%)=XIRR(A2:A10, B2:B10, -0.10) (Useful when anticipating a negative return)
3. Date Sequence and Integrity in XIRR
The XIRR function requires a paired date array: =XIRR(values, dates, [guess]).
- The first date in the date vector must represent the earliest transaction date.
- All subsequent dates must occur on or after the starting date.
- If dates are formatted as text strings rather than true serial date integers, or if later investment dates precede the origin date,
XIRRfails with#NUM!.
Verify that dates are real Excel serial dates using =ISNUMBER(B2).
4. Invalid Numerical Parameters in Range Functions
The #NUM! error also occurs outside finance when numerical parameters request invalid statistical boundaries.
LARGEorSMALLFunctions:=LARGE(A2:A20, k)
Ifkis less than or equal to0, or ifkis greater than the total count of cells in the range (e.g., asking for the 25th largest value in a 20-cell range), Excel returns#NUM!.
Fix: Validate thatkis between1andCOUNT(range).SEQUENCEFunction:=SEQUENCE(rows, [columns])
Entering a negative number forrowsorcolumns(e.g.,=SEQUENCE(-5, 2)) triggers#NUM!.- Square Roots of Negative Numbers:
=SQRT(-25)
Excel does not evaluate imaginary or complex numbers inside standard functions. If negative values can occur, wrap the inner calculation inABS:=SQRT(ABS(A2))(Or use the engineering function=IMSQRT("-25")if working with complex numbers).
Calculation Overflow and Floating-Point Limits
Excel operates within strict numeric limits governed by the IEEE 754 floating-point specification:
- Maximum positive number:
1.7976931348623158E+308 - Smallest positive number:
2.2250738585072014E-308
If a calculation calculates an exponent that breaches these thresholds (for instance, =1000^200 or iterating a compounding interest calculation with an incorrect percentage), Excel overflows and outputs #NUM!.
If a formula containing iterative calculations triggers a workbook-wide calculation freeze or recursive loop, see Troubleshooting “Circular Reference” Warnings that won’t go away. If variables defined inside custom formulas trigger calculation errors before resolving, review Troubleshooting “LET” Function Variable Definition Errors.