XIRR Calculator

Compute Extended Internal Rate of Return (irr with actual dates) for uniform or irregular cash flows.

Same contribution amount on a fixed schedule between start and maturity dates.
$
$

Results

  • XIRR (annual) %
  • Number of Flows
  • Days Span
  • Total Invested $
  • Total Returned $
  • NPV at XIRR (~0) $

This XIRR Calculator computes the annualized internal rate of return (XIRR) from dated cash flows plus an optional final value at maturity. It solves the discount rate that sets net present value (NPV) of all flows to zero, using actual day gaps.

Introduction

XIRR is the annual rate r that makes the present value of irregularly dated amounts sum to zero. Two modes are available: Uniform Contributions (same contribution on a fixed schedule between Start Date and Maturity Date) and Irregular Cash Flows (you enter specific dates and amounts).

Sign convention: investments/outflows are negative; withdrawals/returns are positive. Calculations use day-count based exponents (actual days ÷ 365) and are solved numerically.

How to Use the XIRR Calculator

Follow these steps to enter cash flows correctly and interpret the results.

  1. Pick a Mode.

    Choose Uniform Contributions for equal investments on a set schedule, or Irregular Cash Flows to input arbitrary dates and amounts. This determines how flows are created.

  2. Uniform Contributions setup.

    Select Contribution Frequency, Start Date, and Maturity Date; enter Contribution Amount (treated as an outflow) and Final Value (at maturity) (a positive return). This builds dated flows automatically.

  3. Irregular Cash Flows setup.

    Enter each Date and Amount in Cash Flows. Use negative values for investments and positive for returns; click + Add Cash Flow for more entries. Add Final Value (at maturity) if applicable.

  4. Precision.

    Toggle Show decimals to switch the display precision; it does not change the underlying math.

  5. Calculate.

    Click Calculate to solve for XIRR (annual). Review Number of Flows, Days Span, Total Invested, Total Returned, and NPV at XIRR (~0) to sanity-check your inputs.

  6. Interpret the rate.

    A positive XIRR indicates overall gain; negative means loss. Remember it is annualized based on actual-day timing, not just a simple average.

  7. Adjust and compare.

    Modify dates or amounts (or Contribution Frequency in uniform mode) to test scenarios; use Clear to reset.

    Formulas used

    General definition (all flows, including final value as the last positive amount):

    Uniform contributions (contribution amount each period; final value at maturity):

Tip: XIRR vs IRR vs CAGR: XIRR handles dated, uneven flows; IRR assumes equal-period spacing; CAGR is a single-investment start–end rate with no interim flows.

Frequently Asked Questions

Methodology & Sources

    • Type: Finance (return metric).
    • Goal: Solve for the annual effective rate \(r\) such that the dated cash-flow NPV equals zero.
    • Modes supported:

- Uniform Contributions: Builds a schedule of equal contributions on a fixed frequency (e.g., monthly) from Start Date to Maturity Date, plus a final value at maturity.

- Irregular Cash Flows: User supplies any number of pairs and an optional final value.

Cash-flow assembly

  • Use amounts with dates .
  • Sign convention: investments negative, returns positive.
  • For Uniform Contributions, create one flow per interval at the chosen frequency, all equal to , and add the terminal flow at the maturity date.

Core formula (Actual/365)

    • Let be the day count from the first cash flow date : .
    • XIRR r solves:

    • Derivative for Newton steps:

Numerical solution

    • Initial guess:

or 10% if unknown.

  • Iterate Newton–Raphson: .
  • If Newton diverges or , switch to bracketed bisection on \([-0.9,\ 10]\).
  • Convergence when or . Fail after max 100 iterations.

Outputs

  • XIRR (annual, effective) in percent.
  • Number of flows \(n+1\).
  • Day span \(\max(t_i)\).
  • Total invested \(\sum (-CF_i)^+\).
  • Total returned \(\sum (CF_i)^+\).
  • NPV at XIRR ≈ 0 (sanity check).

Conversions

  • Monthly effective rate from XIRR: .
  • Daily effective rate (Actual/365): .

Assumptions

  • Day-count: Actual/365 fixed; cash flows occur end-of-day.
  • Currency: USD; amounts rounded to \$0.01.
  • No automatic fees/taxes; include them as cash flows.
  • If multiple flows on the same date, they are aggregated.
  • Date range uses Gregorian calendar; leap years honored.

Validation & edge cases

  • Require at least one negative and one positive flow.
  • Duplicate or unsorted dates are normalized.
  • If all flows same sign → undefined (no solution).
  • Multiple sign changes may yield multiple mathematical roots; the algorithm returns the root within the searched bracket.
  • If \(1+r \le 0\) (e.g., \(r \le -100\%\)), fractional exponents become invalid; those regions are excluded.

Worked example

    • Flows: on 2020-01-01; on 2021-01-01.
    • Days t= 366 (leap year 2020).
    • Solve: annual.

      Implementation tips

      • Use high-precision floats; scale cash flows to avoid overflow.
      • Provide user-controlled decimal display but compute at full precision.
      • Show residual NPV to help users diagnose data issues.

Bibliography

  1. (2024). XIRR function (definition & algorithm) — Microsoft Support
    Accessed 2025-10-28
  2. (2003). Internal Rate of Return (NPV/IRR fundamentals) — Massachusetts Institute of Technology
    Accessed 2025-10-28
  3. (2020). Money-Weighted vs. Time-Weighted Return; GIPS guidance — CFA Institute
    Accessed 2025-10-28
  4. (2024). XIRR vs IRR — CFI Education Inc.
    Accessed 2025-10-28