How to calculate your portfolio return when you add or withdraw money
Add money to a portfolio, or take some out, and one question gets four honest answers: simple return, Modified Dietz, time-weighted return (TWR) and money-weighted return (XIRR). One invented portfolio runs through all four, arithmetic shown: a fund up +4.5% whose owner ended slightly behind.
Updated 25.10.2026 · Reading time ~11 min · By the Allocaria editorial team
The short answer
- Judging the investmentsTWR measures the investments.It removes the size and timing of your deposits, so it is the number to set beside a fund or an index.
- Judging your own moneyXIRR measures your own money: it counts when each euro went in.Modified Dietz is a quick estimate of the same view for one period.
- One year, four numbersThe four can disagree, even in sign: in the example −0.25%, −0.33%, +4.5% and −0.33% a year, each correct for its own question.
TWR and XIRR side by side
The measures use the same history of values and deposits but ask different questions. The table sets TWR and XIRR side by side; the cards say each of the four in a sentence.
| Question | TWR (time-weighted) | XIRR (money-weighted) |
|---|---|---|
| What it measures | How the investments performed, whatever you put in or took out | What your own money earned, as a yearly rate, given when each euro went in |
| Size and timing of deposits | None: each stretch between flows is measured on its own, then chained | Large: a deposit just before a fall or a rise changes the result a lot |
Simple return in plain words
The gain divided by the money put in. The quickest check; a euro deposited on the last day counts like one deposited on the first.Modified Dietz in plain words
Like the simple return, but each deposit counts in proportion to the share of the period it was invested. A quick estimate of the money-weighted view.TWR in plain words
Cut the year at every moment money moved in or out. Measure each piece on its own, then multiply the pieces together. The size of a deposit cannot change the answer.XIRR in plain words
Find the one yearly rate at which every deposit, grown for the days it was invested, adds up to what you ended with. A euro invested all year counts for more than a euro invested in the last week.
One portfolio, four numbers: a worked example
An invented investor, an invented fund. Every number is calculated and the steps are shown, so you can repeat them with a calculator or a spreadsheet.
1 Jan: a first deposit
The investor puts €10,000 into a fund.30 Jun: the fund is up 10 percent, and a second deposit arrives
The holding is worth €11,000. The investor adds €10,000, so it is now worth €21,000.31 Dec: the fund is down 5 percent since 30 Jun
The holding is worth €19,950.
The cash flows
| Date | What happened | Amount |
|---|---|---|
| 1 Jan | First deposit | −€10,000 |
| 30 Jun | Second deposit | −€10,000 |
| 31 Dec | Value at the end, counted as money coming back | +€19,950 |
The value through the year
Value of the portfolio through the year
| Date | Event | Value |
|---|---|---|
| 1 Jan | After the first deposit | €10,000 |
| 30 Jun | Just before the second deposit | €11,000 |
| 30 Jun | Just after the second deposit | €21,000 |
| 31 Dec | End of the year | €19,950 |
TWR: chain the sub-periods
| Sub-period | Value at start | Value at end | Return |
|---|---|---|---|
| 1 Jan to 30 Jun | €10,000 | €11,000 | +10.0% |
| 30 Jun to 31 Dec | €21,000 | €19,950 | −5.0% |
How TWR is chained
XIRR: the yearly rate of the investor's money
The rate r is the one that makes the deposits, grown for the days they were invested, equal the value at the end. It has no neat formula; a spreadsheet or a short program finds it by trial.
Modified Dietz: weight the deposit by its days at work
The second deposit was invested for 184 of 364 days, so it counts as 184/364 = 0.5055 of a deposit.
Why the numbers disagree
| Half of the year | Money at work | Fund move | Result |
|---|---|---|---|
| First half | €10,000 | +10% | +€1,000 |
| Second half | €21,000 | −5% | −€1,050 |
| Whole year | €20,000 put in | TWR +4.5% | −€50 |
One year, four numbers
| Measure | Value | What it answers |
|---|---|---|
| Simple return | −0.25% | Gain over money put in; ignores when it went in |
| Modified Dietz | −0.33% | Gain over money weighted by its days at work; not annualised |
| TWR | +4.5% | How did the fund do, whatever was added and when? |
| XIRR | −0.33% a year | What did the investor's money earn, given when it went in? |
Notes. All figures are invented. The dates are day 0, day 180 and day 364 of a 365-day year. XIRR counts actual days divided by 365, as Excel does, and was checked against two independent implementations. Modified Dietz and the simple return are not annualised. No dividends, fees or tax.
CAGR vs XIRR
CAGR, the compound annual growth rate, is how fast one sum grew each year from a start value to an end value, with nothing added or taken out between. It equals XIRR when there are exactly two dated values, and has nowhere to put a deposit when there are more.
| Question | CAGR | XIRR |
|---|---|---|
| Money moved in between | Not allowed: one start value, one end value | Any number of dated deposits and withdrawals |
| Example | €10,000 to €12,100 in two years: +10.0% a year | The same two flows: +10.0% a year, the same number |
Dividends and fees
Dividends and fees need no special formula, only a decision about where they sit: money that crosses the edge of the portfolio is a flow, and money that stays inside is part of its value.
| Event | How it enters | Why |
|---|---|---|
| Dividend reinvested in the portfolio | Stays in the value; no flow | The money never left |
| Dividend sent to your bank | A withdrawal on the date it left | It left |
| Fund or trading cost taken from the account | Lowers the value; no flow | The return is after costs |
A portfolio in more than one currency
Choose one reporting currency, for a euro investor the euro, and convert every value and every flow into it on its own date. The exchange-rate effect then sits inside the result. An invented step: a fund priced in US dollars rises 10 percent while the euro rises 4 percent against the dollar, so its euro value rises by 1.10 ÷ 1.04 − 1 = +5.8%.
| Effect | Move |
|---|---|
| Fund price in US dollars | +10.0% |
| Euro against the dollar | +4.0% |
| Holding in euros | +5.8% |
TWR vs XIRR: which one to use?
It depends on the question being asked, not on which figure looks better. The table pairs common situations with the measure built for them.
| Situation | Look at | Why |
|---|---|---|
| Comparing a result with an index | TWR | An index has no deposits, so the like-for-like measure ignores them |
| Asking how your own money did | XIRR, with the euro result | It counts when each deposit arrived |
| A quick estimate over one period | Modified Dietz | Weights deposits by their days at work; no solver |
| Judging a fund or a manager | TWR | The manager does not choose when clients add or withdraw; standards such as GIPS use time-weighted returns |
How to compare fairly with an index
Compare like with like. TWR is the figure to set beside an index's own return, because an index has no deposits and TWR has had theirs removed.
XIRR needs a twin instead: the same deposits, on the same dates, invested in the index, with the twin's XIRR calculated the same way. Setting an XIRR directly against an index return mixes a measure that depends on your timing with one that does not.
Two details decide whether it is fair. Use the total-return version of an index, which counts dividends; a price index leaves them out. And use the version in your own currency: a euro investor compares with an index quoted in euros, such as MSCI World or the S&P 500 in euros, so the exchange-rate effect sits on both sides.
The same year against an index
| Comparison | Yours | Index or twin | Gap |
|---|---|---|---|
| TWR against the index's TWR | +4.5% | +5.8% | −1.3 points |
| XIRR against the twin's XIRR | −0.33% | +2.56% | −2.90 points |
How to calculate it in Excel or Google Sheets
A broker export, such as an Interactive Brokers activity statement or the Trading 212 history export, lists deposits, withdrawals, dividends and fees as separate dated rows. The dated transfers in and out are the flows; dividends and fees sit inside the value. Layouts differ and change, so check the column names.
List every deposit and withdrawal with its date
A deposit is a negative number, a withdrawal a positive one. Use real date cells, not text.Add the end value as the last row
A positive number, on the date you are measuring to.Write the function
For the example, the flows sit in B2:B4 and the dates in A2:A4, and =XIRR(B2:B4, A2:A4) returns about −0.33%.
| Measure | Pattern | Result |
|---|---|---|
| Simple return | gain ÷ (start value + deposits) | −0.25% |
| Modified Dietz | gain ÷ (start value + each deposit × its share of the period) | −0.33% |
| TWR | (1 + r1) × (1 + r2) − 1 | +4.5% |
| XIRR | =XIRR(values, dates) | −0.33% a year |
Microsoft's documentation says Excel discounts later payments on a 365-day year, as the example does. Google Sheets has an XIRR function with the same two main arguments.
Common mistakes
Comparing XIRR with an index return directly. Compare TWR with the index, and XIRR with a twin.
Reading a yearly rate off a short window. Stretching a few weeks to a year can turn a small move into a large, misleading number.
Forgetting dividends and fees. A price-only series leaves out dividends, and a series before fees leaves out their cost.
Mixing currencies. Convert everything into one currency, on the right dates, before calculating any of the four figures.
Common questions
Neither; they answer different questions. TWR suits comparing a fund, a manager or an index, because it ignores when money was added. XIRR measures what your own money earned, because it counts when each deposit arrived.
Because XIRR follows your money, not the fund. If most of your money went in shortly before a fall, more euros lived through the fall than enjoyed the earlier rise. In the example the fund is up +4.5% for the year while the investor's XIRR is −0.33%.
TWR removes the effect of deposits and withdrawals, so it measures the investments. A money-weighted return, usually calculated as XIRR, includes them, so it measures what your own money earned given when it went in. Without flows, the two agree.
It is a quick estimate of the money-weighted return over one period: the gain divided by the start value plus each deposit weighted by the share of the period it was invested. It is not annualised. In the example: −0.33%.
Write down the start value, every dated deposit and withdrawal, and the end value. Then pick the measure that matches the question: TWR for the investments, XIRR or Modified Dietz for your own money.
List the dated cash flows with deposits as negative numbers and the end value as a positive one, then use =XIRR(values, dates), for example =XIRR(B2:B4, A2:A4). Put the dates in real date cells, not text.
It does when built on total value: price changes plus dividends received or reinvested. A price-only series leaves them out. Check which a figure uses.
Set your TWR beside the index's total return in the same currency, or build a twin, the same deposits on the same dates put into the index, and compare the two XIRRs. Use the total-return version of the index. Both look back.
Further reading
- GIPS Standards, the performance-reporting standard
Rules for calculating and presenting returns, including time-weighted ones.
- XIRR function, Microsoft Support
How Excel calculates a yearly rate for dated cash flows.
In Allocaria
Stress-test a portfolio on the Crisis page →
Allocaria shows both returns for your own portfolio: the time-weighted return for the whole history, and the yearly money-weighted return once there are six months of it.
Request accessClosed beta · by invitation
General information, not investment, tax or legal advice, and not a recommendation about any security. Allocaria is a decision-support tool; it places no orders and holds no money.