Tools
XIRR, IRR & TWR Calculator
What your money earned from dated cash flows, and what the portfolio earned when you can supply the valuations.
Money-weighted annual return (XIRR)
—
what your money earned, timing included
Rates that solve this series
Total paid in
—
every negative amount
Received or still held
—
every positive amount, valuations included
Net gain
—
includes anything still held
Gain on money paid in
—
net gain ÷ total paid in, timing ignored
Period covered
—
first flow to last
Flows used
—
same-day amounts are added together
Periodic IRR
Rate per row—
Time-weighted returna second table, with its own data
A time-weighted return needs the portfolio’s value on every date money moved. Enter those valuations with the flow that happened on each, and the sub-period returns are chained so deposits and withdrawals can neither flatter nor penalise the result.
From the portfolio’s side, the opposite of the table above: positive flow = deposit, negative = withdrawal. The value is the portfolio before that day’s flow.
The two examples are unrelated portfolios, loaded to show each measure working. Enter your own figures in both to compare them.
Time-weighted return
—
whole period, chained across every sub-period
Annualised
—
the chained return, compounded over actual days
Sub-periods
—
one per valuation after the first
Modified Dietz estimate
—
whole period, money-weighted, not annualised
Modified Dietz weights each external flow by how long it was invested. It covers the same period as the time-weighted return beside it, so the two can be read against each other: the gap between them is roughly what the timing of your deposits and withdrawals did to the result, which the chained return is built to remove. They are not the same method, though — one measures your money, the other the investments — so neither belongs under the other’s name. And neither compares with the annualised figure, which is this same period restated as a rate per year.
Two different questions
Money-weighted and time-weighted
A money-weighted return (XIRR) measures what your money earned, counting when each amount arrived. If you happened to buy heavily just before a strong run, your money-weighted return is higher — and that is correct, because you really did make more money.
A time-weighted return removes that effect entirely by chaining the return of each sub-period between flows. It measures the investments rather than the investor, which is why it is the standard for comparing a portfolio with an index and why fund factsheets quote it.
Neither is more correct. They answer different questions, and the common error is quoting one to answer the other.
The conventions used here
XIRR discounts by actual days over a 365-day year, measured from the first flow, which is the convention Microsoft documents for Excel’s XIRR — so a result here should match a spreadsheet. Amounts on the same date are added together, which is exact rather than an approximation, because discounting is linear in the amount at a given date.
IRR instead treats the rows as equally spaced periods and returns a rate per period. Monthly flows through IRR and the same flows through XIRR will differ slightly, because months are not equal lengths. That is not a fault in either.
For the time-weighted return, a flow on a valuation date is treated as happening immediately after that valuation, so money paid in that day earns the next sub-period rather than the last one. The opposite convention gives a different answer from identical data, which is why it is stated.
XNPV = Σ amount_i ÷ (1 + rate) ^ (days_i ÷ 365) → XIRR solves XNPV = 0
sub-period return = value(i) ÷ (value(i−1) + flow(i−1)) − 1
TWR = Π (1 + sub-period return) − 1
When there is no single answer
If the cash flows change direction more than once — bought, sold out entirely, bought again — the equation can have several valid roots. Most calculators return whichever their solver reached first, which produces a precise-looking number that means nothing.
This one scans the whole range, finds every root, and says when there is more than one. The honest reading in that case is that a single internal rate of return does not describe the series, and a time-weighted return or a plain gain figure will serve better.
Questions
What sign should I use?
Take the investor’s point of view: money leaving you is negative, money coming back is positive. The holding you still own is money you have not received yet, so it goes in as a positive amount on today’s date — leave it out and the return will look catastrophic.
Why does my spreadsheet give a slightly different answer?
Check that it is XIRR rather than IRR, and that the final holding value is included with the same date. Beyond that, both solve the same equation to a tolerance, so a difference in the fourth decimal is the solver rather than the arithmetic.
Why will it not show a time-weighted return from my cash flows?
Because a time-weighted return needs the portfolio’s value at each flow date, and cash flows alone do not contain it. Entering those valuations is the only way. Without them, the Modified Dietz figure is the closest available estimate, and it is labelled as an estimate.
Not adviceThese calculators are for information and education. They are not investment advice, not a recommendation, and not a forecast. Results are hypothetical, depend entirely on the assumptions entered, and ignore the taxes, costs and events that apply to any real portfolio. Investments can lose value.