XIRR Calculator
- XIRR is the rate r solving NPV = sum of amount x (1 + r)^(-days/365) = 0 for the flows: $-10,000.00 at day 0, $3,500.00 at day 180, $3,500.00 at day 365, $4,200.00 at day 540.
- Bisection between -99.99% and 10,000% converges to r = 11.85% per year - each flow is discounted by its exact day count over 365, which is what separates XIRR from IRR's equal periods.
- Sanity check at 10%: NPV = $168.75 - positive, so the true return beats 10%, consistent with the XIRR found.
- Totals ignore timing: $10,000.00 went out and $11,200.00 came back, a net of $1,200.00 - XIRR adds the timing back in, which is why it, not the raw totals, is the comparable return.
This XIRR calculator finds the annual rate of return on investments where the cash flows are irregular — money going out and coming back on dates that do not fall neatly one year apart. XIRR is the discount rate that zeroes the net present value of those cash flows, with each amount discounted by its exact day count: amount x (1 + r)^(-days/365). Enter your dates and amounts and the calculator returns the single annual rate that balances the whole series. For example, 10,000 out, then 3,500 at day 180, 3,500 at day 365 and 4,200 at day 540 gives an XIRR of 11.85% per year, with an NPV at a 10% discount rate of $168.75.
That day-by-day discounting is why XIRR is the accepted standard for irregular cash flows: it prices not just how much came back but when. Totals alone mislead — the example above returns 11,200 on 10,000 invested, but only XIRR accounts for the money arriving over 540 days rather than all at once. The timing effect can be subtle: 1,000 out with 500 back at one year and 610 at two years gives 7.01%, just above the 7% the round numbers suggest, because the first return arrives a year early. A top-up also fits: 10,000 out, another 2,000 out at day 180 and 14,500 back at day 365 gives 22.81%, with 12,000 invested and 14,500 returned. This page shows the formula, step-by-step workings, worked examples and sources so you can check every figure yourself.
Worked examples
10,000 out, three returns over 18 months
XIRR (annualised return) = 11.85%. Total invested: $10,000.00; Total returned: $11,200.00; NPV at a 10% discount rate: $168.75. (-10000 $ · 0 · 3500 $ · 180 · 3500 $ · 365 · 4200 $ · 540)
| XIRR (annualised return) | 11.85% |
| Total invested | $10,000.00 |
| Total returned | $11,200.00 |
| NPV at a 10% discount rate | $168.75 |
1,000 out, back over two years
XIRR (annualised return) = 7.01%. Total invested: $1,000.00; Total returned: $1,110.00; NPV at a 10% discount rate: $-41.32. (-1000 $ · 0 · 500 $ · 365 · 610 $ · 730 · 0 $ · 730)
| XIRR (annualised return) | 7.01% |
| Total invested | $1,000.00 |
| Total returned | $1,110.00 |
| NPV at a 10% discount rate | $-41.32 |
Top-up at day 180, exit at one year
XIRR (annualised return) = 22.81%. Total invested: $12,000.00; Total returned: $14,500.00; NPV at a 10% discount rate: $1,273.65. (-10000 $ · 0 · -2000 $ · 180 · 14500 $ · 365 · 0 $ · 365)
| XIRR (annualised return) | 22.81% |
| Total invested | $12,000.00 |
| Total returned | $14,500.00 |
| NPV at a 10% discount rate | $1,273.65 |
Why IRR is not enough
Plain IRR rests on an assumption that rarely survives contact with a real portfolio: that money goes in and comes out at perfectly even intervals. It was built for cash flows spaced one period apart — a payment at the start of year one, a return at the end of each year after that. When that pattern holds, IRR is a clean, well-understood number. When it doesn't, IRR quietly stops answering the question you asked, because it treats a return that lands on day 30 and one that lands on day 340 as if they arrived at the same moment.
Real investments don't cooperate. Money drips in and out on arbitrary dates — a contribution in March, a distribution in August, a top-up after a bonus, a partial sale in November. Compress those dates into tidy annual periods and you lose exactly the information that matters: how long each dollar was actually at work. This is the gap an xirr calculator closes. XIRR is the discount rate that zeroes the NPV of irregular cash flows, each discounted by its exact day count: amount × (1 + r)^(−days/365). No rounding to period boundaries, no pretending that a mid-year deposit sat idle for six months.
A worked example shows how much the timing is worth. Suppose you put out 10,000, then receive 3,500 at day 180, 3,500 at day 365 and 4,200 at day 540. The XIRR is 11.85% per year, and the NPV at a 10% discount rate is $168.75. Look at the totals alone and you'd see 11,200 returned on 10,000 invested — a figure that tells you nothing about the fact that the money arrived over 540 days rather than all at once. Only XIRR prices that. The same discipline explains a subtler case: 1,000 out, 500 back at one year and 610 at two years gives 7.01%, just above the 7% the round numbers suggest, because the first return arrives a year early and therefore compounds for longer.
Top-ups are where equal-period assumptions break down most visibly. Put out 10,000, add another 2,000 out at day 180, and receive 14,500 back at day 365. That's 12,000 invested and 14,500 returned, and the XIRR is 22.81%. A naive period-based calculation has no natural place to put the mid-year 2,000 — it either ignores the date or assigns it to a boundary, and either choice distorts the result. Exact day counts don't have that problem.
The practical lesson is simple: use IRR only when your cash flows genuinely fall on even intervals. For anything with irregular dates — which is most real investing — the day-count method is the honest one, and the difference is often large enough to change a decision.
The equation and how it is solved
Every XIRR calculation rests on one equation: NPV = sum of amount × (1 + r)^(-days/365) = 0. Each cash flow is discounted by its exact day count rather than by whole years, which is what separates XIRR from simpler return measures. Money that arrives at day 180 is discounted over 180 days; money that arrives at day 540 is discounted over 540 days. The xirr calculator solves for the single rate r that makes the sum of all those discounted amounts equal zero, so the rate is defined by the cash flow dates themselves, not by any assumption about when returns occur.
Take the worked example: 10,000 out, then 3,500 at day 180, 3,500 at day 365 and 4,200 at day 540. Substituting each amount and day count into the equation and solving gives an XIRR of 11.85% per year. As a check on what that rate means, discounting the same flows at a flat 10% produces an NPV of $168.75 — a positive figure, which tells you 10% is too low a rate to zero the equation, and the true root sits above it at 11.85%.
The equation has no neat algebraic solution, so it is solved numerically. The method here is a bisection search that brackets the answer between -99.99% and 10,000%. The solver evaluates NPV at the low end and the high end of that range, then repeatedly halves the interval, keeping whichever half contains the sign change, until it converges on the root. For the first example, that search settles on 11.85%. The same procedure handles a top-up: 10,000 out, another 2,000 out at day 180 and 14,500 back at day 365 gives 22.81%, with 12,000 invested and 14,500 returned.
Two cautions follow from the equation. First, totals alone mislead. The first example returns 11,200 on 10,000 invested, but only XIRR prices the fact that the money arrived over 540 days rather than at once. Second, the timing of the first return matters more than round numbers suggest: 1,000 out, 500 back at one year and 610 at two years gives 7.01% — just above the 7% the round numbers imply, because the first return arrives a year early.
Reading the three worked examples
The three worked examples on this page are there to be compared, not just read one at a time. Each one uses the same XIRR method — the discount rate that zeroes the NPV of irregular cash flows, with every amount discounted by its exact day count, amount x (1 + r)^(-days/365) — but each shows a different reason the answer comes out where it does. Put side by side, they show why an xirr calculator is worth using instead of eyeballing totals.
Start with the steady case: 10,000 out, then 3,500 at day 180, 3,500 at day 365 and 4,200 at day 540. That produces an XIRR of 11.85% per year. At a 10% discount rate the NPV is $168.75, which is positive — a useful check, since a rate below the XIRR leaves value on the table. Notice that the money comes back in three installments spread across 540 days, so the rate has to account for each payment sitting at a different distance from day zero.
Now the two-year case: 1,000 out, 500 back at one year and 610 at two years. The round numbers suggest 7%, and the XIRR is 7.01% — just above it. The reason is timing: the first return arrives a year early, and that early money counts for more than a simple total implies. Compare that with the steady case. The steady example returns 11,200 on 10,000 invested, which looks like a fatter deal than the two-year example's 1,110 on 1,000, yet the totals alone mislead: only XIRR prices the fact that the money arrived over 540 days rather than at once. Spread-out returns are penalized for the time they spend outstanding.
The top-up case pushes the other way. Here 10,000 goes out, another 2,000 goes out at day 180, and 14,500 comes back at day 365 — 12,000 invested and 14,500 returned, all inside a single year. The XIRR is 22.81%. The headline gain is 2,500 on 12,000, but a large share of that capital was only at work for the second half of the year, and the whole return lands at day 365. Short, concentrated exposure is what lifts the annualized rate so far above the other two.
Read together, the examples make one point: similar-looking totals can hide very different rates, and earlier or later returns move the answer even when the money involved looks comparable.
- Steady case: 10,000 out; 3,500 at day 180, 3,500 at day 365, 4,200 at day 540 — XIRR 11.85% per year, NPV of $168.75 at a 10% discount rate.
- Two-year case: 1,000 out, 500 back at one year and 610 at two years — XIRR 7.01%, just above the 7% the round numbers suggest, because the first return arrives a year early.
- Top-up case: 10,000 out, another 2,000 out at day 180, 14,500 back at day 365 — 12,000 invested and 14,500 returned, XIRR 22.81%.
When XIRR misbehaves
An XIRR calculator solves for the rate that zeroes the net present value of irregular cash flows, with each amount discounted by its exact day count: amount × (1 + r)^(-days/365). That single equation is elegant, but it does not always have one clean answer. For a given set of flows, there can be more than one rate that zeroes the NPV — or none at all. Knowing when the result can be trusted is as important as getting the number.
Multiple roots appear when the cash flow stream changes sign more than once. A typical investment changes sign once: money goes out, then comes back. But consider a project that pays out early and then needs a top-up. Picture 10,000 out at the start, 3,500 back at day 180, another 2,000 out at day 365, and 14,500 back at day 540. That sequence goes negative, positive, negative, positive — three sign changes. The NPV equation can then bend in ways that cross zero more than once, so several discount rates may satisfy it. A calculator that reports a single figure without checking may be showing you one root while silently ignoring another. If your flows switch sign more than once, treat the output as one candidate, not the definitive answer.
The opposite problem is just as real: if the cash flows never change sign, no solution exists. A stream of pure outflows, or pure inflows, cannot be discounted to zero at any positive rate — the NPV keeps the same sign no matter what rate you try. In that case there is no internal rate of return to find, and a good XIRR calculator should say so rather than return a misleading number or an error without explanation. A quick sign check before you run the math saves confusion.
There is also a subtler assumption built into every XIRR comparison. The rate describes the cash flows themselves, but comparing two XIRRs as if they were equivalent investment choices assumes that interim cash can be reinvested at that same rate until the end of the period. If one option throws off cash early and you can only redeploy it at a lower rate, its real advantage shrinks. Two projects with identical XIRRs are not necessarily equally good if their cash arrives on different schedules — the timing of each flow is what the discounting is pricing.
That is why totals alone mislead. In the worked example — 10,000 out, then 3,500 at day 180, 3,500 at day 365 and 4,200 at day 540 — the investment returns 11,200 on 10,000, which sounds like a simple 12% gain. But the XIRR is 11.85% per year, and the NPV at a 10% discount rate is $168.75. Only the XIRR prices the fact that the money arrived over 540 days rather than all at once. Use the xirr calculator as a timing-aware measure, check your sign changes first, and read the result as a rate on these exact flows — not a promise about what happens to the cash afterward.
FAQs
How is XIRR different from IRR?
IRR assumes cash flows arrive at equal intervals. XIRR instead discounts each flow by its exact number of days over 365, so irregular dates are priced correctly. That means an investment with money in and out on uneven dates gets a return figure that reflects when each payment actually happened, not a simplified schedule.
What does an XIRR of 11.85% mean?
In the first example, the flows are 10,000 out, then 3,500, 3,500 and 4,200 back over 540 days. Those flows are equivalent to a steady 11.85% annual return. As a check, at a 10% discount rate their NPV is still positive at $168.75, so the true rate sits above 10%.
Can XIRR be negative?
Yes. If the discounted value of the returns cannot cover the outflows at any positive rate, the root is negative. The search continues down to the -99.99% bound, which is the lowest rate the calculator will report before treating the problem as unsolvable.
Why does my XIRR have no solution?
The flows need at least one sign change. All-out or all-in flows never cross zero NPV, so no rate solves the equation. Several sign changes can also produce several valid XIRRs instead of one, which makes a single answer unreliable.
Should I use actual dates or day counts?
Both describe the same thing. This calculator takes days from the first flow, which is what a spreadsheet's XIRR computes from the dates you give it. Entering dates or entering day offsets should therefore lead to the same result.
Is XIRR the same as CAGR?
Only for a single outflow followed by a single inflow. With intermediate flows, like the 22.81% top-up example, CAGR has no way to price the extra 2,000 at day 180. XIRR accounts for that mid-period cash flow, so the two measures diverge once money moves in or out along the way.