XIRR calculator
When money goes into an investment and comes out of it at different times, a plain percentage gain hides how hard that money actually worked. Paste your dated cash flows, with deposits as negative numbers and withdrawals or today's value as positive, and the calculator finds the XIRR: the yearly return that matches those exact dates. The simple return sits alongside it, so you can see how much timing changes the answer.
Money in and money out
Totals across the whole period, and what the same deposits would have become at your benchmark rate.
Each cash flow
Every cash flow, how long after the first it happened, and its value discounted back to the start at your XIRR. The discounted values sum to zero.
| Date | Amount | Years from start | Discounted at XIRR |
|---|
How XIRR is solved
XIRR has no direct formula. The calculator searches for the rate at which the discounted cash flows add up to zero, the same way spreadsheet XIRR functions do.
Time each cash flow
Count the days from the first cash flow and divide by 365.
t = (date − first date) ÷ 365
Discount each cash flow
Discount every amount to the first date using a trial rate r.
present value = amount ÷ (1 + r)t
Solve for the rate
Change r until the present values total zero, using Newton's method with bisection as a fallback.
Σ amount ÷ (1 + r)t = 0
Simple return
For comparison, total gain divided by total money put in, with timing ignored.
simple = (out − in) ÷ in
Benchmark
Each deposit grown at the benchmark rate to the last date, minus withdrawals grown the same way.
value = Σ deposit × (1 + rate)years left
XIRR FAQ
What does XIRR measure?
The yearly return that accounts for exactly when each amount went in or came out: the rate at which all your cash flows, discounted back to the start, sum to zero. It is the fairest measure of return for an investment you added to or withdrew from at various times.
Why does XIRR differ from my simple return?
A simple return divides total gain by total money invested and ignores timing. Invest $1,000 a month for a year, end with $13,000, and the simple return is about 8 percent; but most of that money was invested for only a few months, so the true yearly rate is much higher. XIRR captures that.
How should cash flows be entered?
One per line, a date then an amount. Money you put in is negative; money you took out, or today's value, is positive. Year-month-day dates such as 2026-03-15 work best, and you need at least one negative and one positive amount.
How do I include an investment I still own?
Add a last line with today's date and the current value as a positive amount, as if you sold today. That is how brokers and fund platforms usually calculate a personal rate of return.
Does this match XIRR in Excel or Google Sheets?
Yes. It solves the same equation as the spreadsheet XIRR function, counting days between dates on a 365-day year, so results should agree to within rounding.
Why might XIRR give an error or an odd result?
If every amount has the same sign, no rate can balance them. Very short periods can also produce huge annual figures, because a small gain over a few days gets scaled up to a year. Check dates and signs if something looks wrong.