Cash-flow return calculator

XIRR Calculator

CAGR only works when there is one starting value and one ending value. When money goes in or comes out along the way, XIRR gives the annual rate that accounts for the size and date of every cash flow.

Free browser calculator

Calculate XIRR or IRR from cash flows

Enter money you put in as a negative amount and money you take out (including the final value) as a positive amount.

1
2
3
4
5

Instant result

XIRR: 9.1191%

XIRR (annual)
9.1191%
Total invested
14,000
Total returned
19,000
Net gain
5,000
Multiple on money
1.36×
Span
4 years
Naive CAGR of totals
7.93%

The naive CAGR treats all money as if it were invested on the first date and returned on the last date. The gap between 7.93% and the XIRR shows how much the timing of each deposit and withdrawal matters.

What XIRR measures

XIRR is the annual discount rate that makes the net present value of a set of dated cash flows equal to zero. Put differently, it is the single constant annual rate that would turn your deposits into exactly the withdrawals and ending value you actually received, on the dates you received them.

Because each cash flow is weighted by how long it was invested, XIRR is a money-weighted return. A large deposit made just before a strong year raises XIRR more than a small deposit made at the same time. That is the main difference from CAGR, which only looks at a beginning value, an ending value, and the time between them.

Σ Cᵢ ÷ (1 + XIRR)^((dᵢ − d₀) ÷ 365) = 0

How to enter cash flows

Use one row per cash flow. Money you put in (the initial purchase, later contributions, fees you paid in) is negative. Money you take out (withdrawals, dividends you did not reinvest, and the current or final value of the position) is positive.

If the investment is still open, add the current market value as a positive cash flow dated today. Without that final positive value there is nothing for the calculation to solve, so the calculator asks for at least one negative and one positive amount.

  • Deposit or purchase → negative amount on the trade date.
  • Withdrawal, sale, or cash dividend received → positive amount on the payment date.
  • Reinvested dividends → leave them out; they are already inside the ending value.
  • Open position → current value as a positive amount on the valuation date.

Worked example: the spreadsheet reference case

Microsoft documents the following example for the Excel XIRR function. This calculator returns the same result, 37.34%, which is a useful check that the date convention and solver match spreadsheet behavior.

DateCash flow
2008-01-01−10,000
2008-03-01+2,750
2008-10-30+4,250
2009-02-15+3,250
2009-04-01+2,750
XIRR≈ 37.34% per year

Why timing changes the answer

Two investors can put in the same total and take out the same total but earn different returns. Suppose both invest 10,000 on 2020-01-01, add another 10,000 later, and the account is worth 26,000 on 2025-01-01.

If the second 10,000 goes in on 2021-01-01, that money is exposed for four years and the XIRR is about 5.99%. If it goes in on 2023-01-01, the same gain is earned in less time and the XIRR is about 7.59%. A naive CAGR that treats the full 20,000 as invested on day one and grows it to 26,000 over five years reports only about 5.38%, understating both cases.

The calculator shows this naive CAGR of totals next to the XIRR so you can see how much the timing of deposits and withdrawals matters for your own numbers.

ScenarioSecond depositXIRRNaive CAGR of totals
Early top-up2021-01-01≈ 5.99%≈ 5.38%
Late top-up2023-01-01≈ 7.59%≈ 5.38%

XIRR vs IRR vs CAGR

Switch the calculator to “IRR — equal periods” when the cash flows are evenly spaced. The result is a rate per period: annual if each row is one year apart, monthly if each row is one month apart. To turn a monthly IRR into an annual rate, compound it: (1 + monthly IRR)^12 − 1.

When there is exactly one outflow followed by one inflow, XIRR and CAGR describe the same thing and give the same answer for the same dates.

MeasureInputsTimingTypical use
CAGROne beginning value, one ending value, elapsed timeEndpoints onlyRevenue, users, a lump-sum investment
IRRA series of cash flows at equal intervalsPosition in the sequenceProject cash flows, annual or monthly schedules
XIRRCash flows with specific datesActual days ÷ 365Brokerage accounts, irregular contributions, private investments

How the calculator solves XIRR

There is no closed-form formula for XIRR, so it has to be found numerically. The calculator starts from a 10% guess and refines it with Newton’s method. If that fails to converge, for example when the cash flows produce a very flat or steep curve, it falls back to bisection between −99.9999% and an expanding upper bound. Elapsed time uses actual days from the earliest date divided by 365, the same convention as the Excel and Google Sheets XIRR functions.

Calculations run entirely in your browser. Cash-flow amounts and dates are not sent to a server.

Limitations to keep in mind

  • Short holding periods can produce extreme annualized numbers. A 5% gain over one month annualizes to roughly 80%; that is mathematically correct but rarely repeatable.
  • Cash flows that change sign several times can have more than one valid rate. The calculator returns the root it converges to; if the result looks implausible, check the signs and dates.
  • XIRR does not show risk, drawdowns, or how a benchmark performed over the same dates.
  • XIRR is a money-weighted return. Fund managers usually report time-weighted returns, which remove the effect of investor deposits and withdrawals, so the two numbers are not directly comparable.

Reproduce the result in a spreadsheet

Put the amounts in one column and the dates in the next, then use =XIRR(amounts, dates) in Excel or Google Sheets. For equally spaced cash flows, use =IRR(amounts). The numbers should match this calculator to several decimal places.

=XIRR(B2:B6, A2:A6)

Frequently asked questions

Should the current value of my account be positive or negative?

Positive. Treat it as if you sold everything on the valuation date and received the cash. Deposits are negative because money leaves your pocket.

Why is my XIRR different from the return my broker shows?

Brokers often show time-weighted return or a simple total return. XIRR is money-weighted, so it rises or falls depending on when you added or withdrew money. Also check that fees and the exact valuation date are included the same way.

Can XIRR be negative?

Yes. If you took out less than you put in, adjusted for timing, XIRR is negative. It cannot be below −100%.

What is the difference between XIRR and IRR?

IRR assumes every cash flow is exactly one period apart. XIRR uses the actual date of each cash flow, so it handles irregular contributions and withdrawals.

Does XIRR assume cash flows are reinvested at the XIRR rate?

It is often described that way because the same discount rate is applied to every flow. In practice, XIRR summarizes what actually happened; it does not say what rate you could earn on withdrawn cash.

Sources

These references were used to check definitions, formulas, and spreadsheet behavior. They are linked so you can verify the same points independently; they do not imply endorsement of this site.

  1. XIRR function — Microsoft Support
  2. IRR function — Microsoft Support
  3. XNPV function — Microsoft Support
  4. XIRR — Google Docs Editors Help

Last updated

Calculation methodology

Calculation methodology

Related guides and tools