XIRR Calculator (Irregular Cash Flow Rate of Return)
Calculate the effective annual rate of return (XIRR) from cash flows with irregular dates and amounts — extra contributions, partial withdrawals, dividends — using the Newton-Raphson method. Ideal for recurring investments or investments with multiple buy/sell events.
What is XIRR (irregular cash flow rate of return)?
XIRR (Extended Internal Rate of Return) works backward from a series of cash flows with irregular dates and irregular amounts to find the single compounded annual rate that would explain all of them together. Unlike CAGR or a simple investment-return calculation — both of which assume a single lump-sum contribution followed by a single lump-sum payout — XIRR can account for the actual calendar dates of recurring contributions, partial withdrawals, dividend payments, or any combination of irregular buy and sell events.
This tool lets you add as many date-and-amount rows as you need, then numerically solves for the annual rate at which the net present value (NPV) of all those cash flows equals zero, using the Newton-Raphson method (falling back to bisection search when Newton-Raphson does not converge). Enter contributions and purchases as negative amounts and returns, withdrawals, or distributions as positive amounts. The calculation requires at least one negative value, one positive value, and at least two distinct dates.
How to use the XIRR calculator
- Enter your initial investment Add the date you started investing and a negative amount for that first outflow in row one
- Add a row for every additional cash flow Click "Add row" for each additional contribution (negative) or partial withdrawal/dividend (positive), entering the actual date each occurred
- Enter your final payout Add the current value, sale proceeds, or final distribution as a positive amount in the last row
- Review the result The tool automatically displays the effective annual return (XIRR), along with total invested, total returned, net profit, and the holding period in days
Tips for getting more out of it
- Getting the sign wrong will throw off your result — always enter outgoing money (investments, contributions) as negative and incoming money (returns, distributions) as positive.
- To include unrealized gains or losses, add a final row using today's date with the investment's current market value entered as a positive amount — this gives you an up-to-date XIRR that reflects paper gains as well as realized ones.
- If you only have a single lump-sum investment and a single payout, our simpler CAGR calculator will give you the same answer with less data entry. Reach for this tool once there is more than one contribution or withdrawal involved.
- Cash flows spaced only a few days apart can produce an annualized rate that looks unexpectedly large or small once compounded out to a full year — it is worth reviewing the total invested and total returned figures alongside the XIRR percentage itself.
Use cases
Check the real return on a dollar-cost-averaging plan
See the single effective annual return for a fund or stock you bought into gradually at irregular intervals, rather than all at once
Evaluate real estate investment returns
Combine the upfront purchase cost, ongoing rental income or extra repair expenses, and the eventual sale proceeds — all at their actual dates — into one rate of return
Confirm the return on a fund sold across multiple transactions
If you sold or redeemed an investment in several separate transactions rather than all at once, entering each date and amount gives you an accurate effective return
Choose between this tool and our CAGR calculator
Use the CAGR calculator for a simple beginning-value-to-ending-value comparison, and use this tool whenever there are multiple contributions or withdrawals along the way
Glossary
- XIRR (Extended Internal Rate of Return)
- A compounded effective annual rate of return derived from multiple cash flows that occur on irregular dates and in irregular amounts. Where an ordinary IRR (internal rate of return) assumes evenly spaced periods (such as every year or every month), XIRR uses the actual calendar dates directly, making it accurate for cases with irregular contributions or withdrawals.
- Net present value (NPV)
- The sum of all cash flows discounted back to today's value at a given rate. XIRR is defined as the specific discount rate at which this NPV equals exactly zero.
- Newton-Raphson method
- An iterative numerical algorithm for finding the root (the point where a function equals zero) of an equation. To calculate XIRR, the tool treats NPV as a function of the annual rate and uses the Newton-Raphson method to quickly narrow in on the rate where NPV crosses zero.
- Cash flow
- A movement of money at a specific point in time. Money going out — such as an investment or contribution — is treated as negative, while money coming in — such as a dividend or sale proceeds — is treated as positive.
- Internal rate of return (IRR)
- The discount rate that makes the net present value of a series of cash flows equal to zero. XIRR extends this concept to work with cash flows that occur at irregular, real-world dates rather than assuming they are evenly spaced.
Frequently asked questions
Side Note — Why a simple return calculation can be misleading
When people estimate an investment's return, the most common shortcut is a simple calculation: (amount returned minus amount invested) divided by amount invested. The trouble is that this ignores the "when" entirely — turning $1,000,000 into $1,500,000 in a single year is a very different result from turning the same amount into $1,500,000 over ten years, even though both look like a 50% return under the simple formula. XIRR fixes this by weighing every cash flow according to exactly how long it has been compounding, which makes it possible to fairly compare investments made at different times.
XIRR is especially valuable when money moves in and out more than once, as with recurring contribution plans or real estate. Consider a fund you bought into gradually over several years: money invested early has had far longer to compound than money invested more recently, even if the dollar amounts are identical. Looking only at the total invested versus the total returned hides this difference entirely and can make an investment look more, or less, efficient than it really was. Because XIRR discounts each cash flow using its own specific date, it can consistently evaluate even a complicated series of contributions and withdrawals.
Under the hood, the calculation borrows a concept familiar from finance textbooks: net present value (NPV). NPV discounts money received in the future back to what it is worth today, and XIRR is simply the discount rate at which that NPV works out to exactly zero. There is no closed-form formula to solve for this rate directly, which is why practical implementations rely on iterative numerical methods such as Newton-Raphson — the same approach used internally by the equivalent function in most spreadsheet programs.