XIRR explained: formula, worked example and common mistakes
Find the true yearly return on investments you added to and withdrew from on different dates. No sign-up, your numbers stay in your browser.
Updated
What is XIRR?
XIRR stands for Extended Internal Rate of Return. It is the annualized return on a series of cash flows that happen on irregular dates — deposits on different days, withdrawals at random times, dividends credited quarterly. If you put money into an investment on more than one occasion, or took money out before the end, XIRR is the only number that tells you what you actually earned per year.
The reason XIRR exists is that the simpler metric, CAGR (Compound Annual Growth Rate), only works for a single lump-sum investment with no additions or withdrawals. The moment you add a second deposit, CAGR stops being meaningful — because some of your money was invested for the full period and some was invested for only part of it. XIRR solves this by finding the single annualized rate that, if applied to every cash flow on its actual date, would make the present value of all inflows equal to the present value of all outflows.
A concrete example makes this clearer. Suppose you invest 10,000 on January 1, 2024, another 5,000 on June 1, 2024, another 5,000 on January 15, 2025, and your account shows 22,000 on January 1, 2026. Your absolute return is 2,000 on 20,000 invested — 10% in two years, you might think. But the 10,000 was at work for 2 years, the first 5,000 for 1.7 years, and the second 5,000 for only 11.5 months. XIRR weighs each cash flow by how long it was actually deployed, and the answer comes out to roughly 6.4% per year. That 6.4% is the number you can compare to a savings account APY, an index fund’s annualized return, or any other annual rate. Without XIRR, you have no apples-to-apples comparison.
XIRR is the standard return metric that mutual fund platforms, brokerages, and portfolio trackers report on your statements. When a broker or fund platform puts an XIRR figure on your statement, that is the metric this calculator produces.
The XIRR formula
There is no closed-form formula for XIRR. It cannot be solved algebraically — it must be found by iteration. Here is the equation XIRR solves:
0 = Σ [ P_i / (1 + r) ^ ((d_i - d_0) / 365) ]
Where:
- P_i = the cash flow on date i (negative for money you put in, positive for money you take out)
- d_i = the date of cash flow i
- d_0 = the date of the first cash flow
- r = the XIRR (the annualized return we are solving for)
- Σ = sum over all cash flows
The calculator starts with a guess for r (usually 10%), plugs every cash flow into the equation with its actual date, sums the present values, and checks if the result is zero. If the sum is positive, the guess was too low — try a higher r. If negative, the guess was too high — try a lower r. The calculator repeats this process, narrowing in on the r that makes the sum exactly zero. Mathematically this is called the Newton-Raphson method, and it typically converges in 5 to 20 iterations.
Worked example with the four cash flows from the previous section:
| Date | Cash flow | Days from start | Discount factor at r=6.4% | Present value |
|---|---|---|---|---|
| 2024-01-01 | -10,000 | 0 | 1.0000 | -10,000.00 |
| 2024-06-01 | -5,000 | 152 | 1.0271 | -4,868.00 |
| 2025-01-15 | -5,000 | 380 | 1.0692 | -4,676.00 |
| 2026-01-01 | +22,000 | 731 | 1.1334 | +19,413.00 |
| Sum | -131.00 |
Close to zero (the small residual is because 6.4% is a rounded guess — the true XIRR is 6.42%). The negative sign on outflows and the positive sign on the final inflow are critical: investments are negative because they are money leaving your pocket, the final value is positive because it is money coming back to you. Get the signs backwards and XIRR will return an error or a nonsense number.
The calculator runs this exact iteration every time you add or edit a row. Open the calculator and try it with your own transaction history — most brokerages let you export a CSV of your transactions, which you can paste directly into the calculator.
When to use XIRR (and when not to)
Use XIRR when:
- You made multiple investments on different dates (the most common real-world scenario for retail investors).
- You made withdrawals before the end of the period — selling part of a position, taking dividends in cash, or moving money between funds.
- You want to compare your actual investment performance to a benchmark like a broad market index, which is reported as an annualized return. XIRR is the only metric that puts your irregular cash flows on the same annual basis.
- You are comparing two different investment accounts (e.g., a brokerage account vs. a workplace retirement scheme)) to see which one is performing better. XIRR normalizes for the fact that you contributed to them on different schedules.
- You are reporting returns to a spouse, partner, or accountant and need a single number that accurately represents performance.
When NOT to use XIRR:
- If you made a single lump-sum investment and never added or withdrew, use CAGR instead. CAGR is mathematically identical to XIRR in the single-cash-flow case but is simpler to compute and explain. Use the CAGR mode of the same calculator.
- If you are projecting future returns on a hypothetical investment, use the Compound Interest Calculator. XIRR is a backward-looking measure of actual past performance, not a forward projection.
- If you invest the same amount every month (a systematic investment plan, SIP), the SIP / Monthly Investment Future Value calculator is purpose-built for that pattern and gives you the future value, not just the rate.
- If you are calculating the return on a single stock position you bought once and sold once, you can use the simpler ROI calculation: (sale price - purchase price) / purchase price. XIRR gives the same answer but is overkill for one transaction.
Common mistakes people make
1. Mixing up the sign convention. Money you put in must be negative; money you take out (or the current value) must be positive. The sum of all cash flows plus the final current value is your total profit. If you flip the signs, XIRR returns a negative number that looks like a loss even when you made money. Always enter outflows as negative.
2. Forgetting the final “current value” cash flow. XIRR requires a positive terminal value to balance the negative investments. If you only enter your deposits and forget to add today’s current balance as a positive final cash flow, the calculator will return an error or a nonsensical result. The “current value” entry on the date “today” is the most common omission.
3. Confusing XIRR with absolute return. Absolute return is simply (final - invested) / invested — a percentage of total profit against total capital. It ignores time entirely. A 50% absolute return over 1 year is excellent; the same 50% over 10 years is mediocre. XIRR annualizes the return so you can compare across different time horizons. If someone tells you their portfolio is “up 80%” without specifying the period, absolute return is meaningless — ask for XIRR.
4. Using XIRR on short time horizons. XIRR annualizes any return, even over a few days. A 5% gain in a week annualizes to roughly 1,200% XIRR — which sounds spectacular but is meaningless because you cannot sustain it. Use XIRR for periods of at least one year, ideally three or more, to get a representative annualized figure. For shorter periods, report the absolute return and the period explicitly.
5. Not annualizing dividends and interest correctly. If your investment pays dividends or interest, those are entered as positive cash flows on the dates they were credited. Leaving them out understates your return. If you reinvest dividends automatically, do not enter them as separate cash flows — the reinvestment is already captured in the higher current value of the holding.
Frequently asked questions
What is the difference between XIRR and CAGR?
CAGR (Compound Annual Growth Rate) works only when you have a single lump-sum investment: one outflow at the start, one inflow at the end. The moment you make a second deposit or take a partial withdrawal, CAGR cannot handle the irregular timing. XIRR generalizes CAGR to any series of cash flows on any dates. For a single lump-sum investment, XIRR and CAGR return the same number — XIRR is the more general tool.
What is the difference between XIRR and IRR?
IRR (Internal Rate of Return) assumes all cash flows happen at equal intervals — typically annual. XIRR (Extended IRR) allows cash flows on any dates, even irregular ones. The Excel function `=IRR()` uses IRR; the Excel function `=XIRR()` uses XIRR. For real-world investing, where you might invest on January 5, March 22, and August 14 of different years, XIRR is the correct choice.
Why does my brokerage show a different XIRR than this calculator?
Brokerages sometimes use different conventions for the day count (365 vs. 360 days), for handling dividends (cash vs. reinvested), or for the timing of the current-value snapshot (end-of-day vs. real-time). Differences of 0.1-0.3 percentage points are normal. Larger differences usually mean one of you is missing a transaction or counting dividends differently. Pull your transaction history and verify each cash flow is in the calculator with the correct date and sign.
Can XIRR be negative?
Yes. If your final value is less than the total you invested, XIRR is negative. A negative XIRR means you lost money on an annualized basis. A -7% XIRR over a 3-year period means your investment shrank at an average rate of 7% per year.
Is a 12% XIRR good?
It depends on what you are comparing against. Over the last 30 years, the US stock market (a broad market index) has averaged about 10% nominal annual return, or roughly 7% after inflation. So a 12% XIRR over a multi-year period would beat the market — which is hard to sustain. For a fixed-income investment like a bond or CD, 12% would be exceptional. Compare your XIRR to a relevant benchmark, not to an absolute number.
How is XIRR different from absolute return?
Absolute return is the simple percentage profit: (final - invested) / invested. It does not account for time. A 30% absolute return over 6 months is phenomenal; the same 30% over 10 years is poor. XIRR annualizes the return so you can compare across periods. Always prefer XIRR when cash flows span more than one year.
Does XIRR account for inflation?
No. XIRR is a nominal return, not a real return. If your XIRR is 10% and inflation averaged 3%, your real return is approximately 7% per year. To see the inflation-adjusted version of your returns, run your final XIRR through the Inflation and Real Return calculator.
Can XIRR handle monthly SIP investments?
Yes, XIRR handles SIPs perfectly — every monthly contribution is a separate dated cash flow. However, if you want to project the future value of a planned SIP rather than measure past performance, use the SIP / Monthly Investment Future Value calculator instead. XIRR is backward-looking; SIP future value is forward-looking.
This tool shows math, not advice.
Cite this page
Copy this line into a reference list, a report or a spreadsheet note.
Investment Math Calculator. “XIRR Calculator”. Updated 2026-10-27. https://investmentmathcalculator.com/guides/xirr-calculator/
Disclaimer: For education only. These calculators show arithmetic and hypothetical scenarios. They are not investment, tax or legal advice and do not recommend any security or product. Consult a licensed adviser in your country before acting.