Guides

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.

Information only
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.

Updated 25.10.2026 · Reading time ~11 min · By the Allocaria editorial team

The short answer

  1. 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.
  2. 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.
  3. 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.

TWR and XIRR compared
QuestionTWR (time-weighted)XIRR (money-weighted)
What it measuresHow the investments performed, whatever you put in or took outWhat your own money earned, as a yearly rate, given when each euro went in
Size and timing of depositsNone: each stretch between flows is measured on its own, then chainedLarge: 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. 1 Jan: a first deposit

    The investor puts €10,000 into a fund.
  2. 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.
  3. 31 Dec: the fund is down 5 percent since 30 Jun

    The holding is worth €19,950.

The cash flows

Cash flows from the investor's side
DateWhat happenedAmount
1 JanFirst deposit−€10,000
30 JunSecond deposit−€10,000
31 DecValue at the end, counted as money coming back+€19,950

The value through the year

Value of the portfolio through the year

Portfolio value through the year, with two depositsValue of the invented portfolio. 1 Jan: €10,000 deposited. By 30 Jun the fund is up 10 percent and the holding is worth €11,000. €10,000 more is deposited, so it is worth €21,000. By 31 Dec the fund is down 5 percent from 30 Jun and the holding is worth €19,950.€4k€8k€12k€16k€20k€24k1 Jan30 Jun31 Dec+€10,000 deposit+€10,000 deposit€10,000€11,000€21,000€19,950fund +10%fund −5%
Value of the holding at the key dates
DateEventValue
1 JanAfter the first deposit€10,000
30 JunJust before the second deposit€11,000
30 JunJust after the second deposit€21,000
31 DecEnd of the year€19,950
Solid line: the holding's value. Dashed: the two deposits. Straight lines join the dated values; the path between is not shown.Illustrative example, not a forecast.

TWR: chain the sub-periods

Return of each sub-period
Sub-periodValue at startValue at endReturn
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

Period 1 · 1 Jan to 30 Jun× 1.10€10,000 grew to €11,000
Period 2 · 30 Jun to 31 Dec× 0.95€21,000 fell to €19,950
Whole year× 1.045minus 1 = TWR +4.5%
Each stretch is measured on its own; the growth factors are multiplied.Illustrative example, not a forecast.
TWR = (1.10 × 0.95) − 1 = 1.045 − 1 = +4.5%

XIRR: the yearly rate of the investor's money

−10,000 − 10,000 ÷ (1 + r)^(180/365) + 19,950 ÷ (1 + r)^(364/365) = 0, which gives r = −0.33% a year

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.

Modified Dietz = −50 ÷ (10,000 + 184/364 × 10,000) = −50 ÷ 15,055 = −0.33%

Why the numbers disagree

Where the euros were gained and lost
Half of the yearMoney at workFund moveResult
First half€10,000+10%+€1,000
Second half€21,000−5%−€1,050
Whole year€20,000 put inTWR +4.5%−€50

One year, four numbers

Simple return, Modified Dietz, TWR and XIRR for the same yearFour descriptions of the same year. Simple return, gain over money put in: −0.25%. Modified Dietz, gain over days-weighted money: −0.33%. TWR, the fund: +4.5%. XIRR, your money, per year: −0.33%. In the example €20,000 was put in and €19,950 was there at the end.Simple return · gain over money put in−0.25%Modified Dietz · gain over days-weighted money−0.33%TWR · the fund+4.5%XIRR · your money, per year−0.33%
Four numbers for the same year
MeasureValueWhat 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 yearWhat did the investor's money earn, given when it went in?
TWR describes the fund; the other three describe the investor's money. Hatched bar: a negative result.Illustrative example, not a forecast.
What the example shows
The fund earned +4.5%, yet the investor ended €50 short of the money put in, because the bigger deposit arrived just before the fall. Both are true: one describes the fund, the other the person.

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.

CAGR and XIRR compared
QuestionCAGRXIRR
Money moved in betweenNot allowed: one start value, one end valueAny number of dated deposits and withdrawals
Example€10,000 to €12,100 in two years: +10.0% a yearThe 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.

How dividends, fees and transfers enter the calculation
EventHow it entersWhy
Dividend reinvested in the portfolioStays in the value; no flowThe money never left
Dividend sent to your bankA withdrawal on the date it leftIt left
Fund or trading cost taken from the accountLowers the value; no flowThe 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%.

An invented foreign-currency step, seen from the euro
EffectMove
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.

Which return answers which question
SituationLook atWhy
Comparing a result with an indexTWRAn index has no deposits, so the like-for-like measure ignores them
Asking how your own money didXIRR, with the euro resultIt counts when each deposit arrived
A quick estimate over one periodModified DietzWeights deposits by their days at work; no solver
Judging a fund or a managerTWRThe manager does not choose when clients add or withdraw; standards such as GIPS use time-weighted returns
Not a forecast
Both are historical. Neither predicts the future, and neither says what to do next.

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.

Example
Suppose an index moved +8% and then −2% over the same two halves. Its TWR is +5.8%, against the fund's +4.5%. The twin puts the same two deposits into it on the same dates and ends at €20,384: an XIRR of +2.56%, against the investor's −0.33%.

The same year against an index

The fund and the investor against an index and its twinThe same year against an index. Fund TWR, set against the index's TWR: +4.5%. Index TWR, an index has no deposits: +5.8%. Your XIRR, set against the twin's XIRR: −0.33%. Twin XIRR, your deposits, put into the index: +2.56%. In the example €20,000 was put in and €19,950 was there at the end.Fund TWR · set against the index's TWR+4.5%Index TWR · an index has no deposits+5.8%Your XIRR · set against the twin's XIRR−0.33%Twin XIRR · your deposits, put into the index+2.56%
Like with like
ComparisonYoursIndex or twinGap
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
Compare the first two bars with each other, and the last two with each other. Hatched: negative.Illustrative example, not a forecast.

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.

  1. 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.
  2. Add the end value as the last row

    A positive number, on the date you are measuring to.
  3. 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%.
Patterns for a spreadsheet, with the example's results
MeasurePatternResult
Simple returngain ÷ (start value + deposits)−0.25%
Modified Dietzgain ÷ (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

Further reading

In Allocaria

Stress-test a portfolio on the Crisis page →

See what the plans include →

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.

Portfolio return with deposits: Dietz, TWR, XIRR — Allocaria