Price gain and the return on a single purchase
If you bought once and did not deposit, buy or sell anything afterwards, the sum is short. Your price gain is the current value minus the purchase cost. Add your transaction costs to the purchase cost: you paid those too.
price return = (current value − purchase cost) ÷ purchase cost
If you received dividends, add them for your total return: total return = (current value − purchase cost + dividends received) ÷ purchase cost.
An example: you bought for €2,000, it is now worth €2,300 and you received €60 in dividends. Your price gain is +€300, a price return of +15.0%. With the dividends your result is +€360, or +18.0%.
If you bought in parts, your purchase cost is everything you paid in total. The percentage then tells you what you earned on that total, but not how long each part was invested. For a portfolio with deposits and withdrawals you need the formulas below.
Average return per year
Over several years you often want a return per year. The plain average of your yearly returns is the wrong sum for that. Say your portfolio grows from €10,000 to €12,000 in the first year, +20.0%, and falls to €9,600 in the second year, -20.0%. The plain average is 0.0%, but you are -4.0% below where you started.
The right average is the geometric one: take the return over the whole period and take the nth root of it, where n is the number of years. average per year = (1 + R)1/n − 1, where R is the return over the whole period. CFA Institute’s GIPS standards calculate a return per year the same way: with the geometric mean, not the arithmetic mean.1
In the example that is -2.0% per year. This average is also called CAGR (compound annual growth rate). If you take the end value divided by the start value, minus one, as R, you must not have deposited or withdrawn anything in those years, or your own money counts as growth. With deposits, use XIRR, or take your time-weighted return as R.
Do not turn a return over less than a year into a yearly figure. The GIPS standards do not allow it: it turns a few months into an annual number that was never actually achieved.2
Modified Dietz: return over a period with deposits
If you deposited or withdrew money, you do not divide your result in euros by your start value, but by the capital that was invested on average. That is the Modified Dietz method. The formula from the GIPS handbook:3
R = (EV − BV − ΣCF) ÷ (BV + Σ CFi × wi)
Here EV is the value at the end, BV the value at the beginning and CF a deposit (positive) or withdrawal (negative). Each deposit or withdrawal gets a weight: wi = (D − Di) ÷ D, where D is the number of days in the period and Di the number of days from the start to that deposit. Money that came in early in the period counts almost fully. Money from just before the end hardly counts.
The numerator is your result in euros: the value at the end, minus the value at the start, minus what you deposited net. So deposits and withdrawals are never profit or loss. Under GIPS, dividends and interest are not external cash flows: they count in your result, not as a deposit.4
The advantage, according to the GIPS handbook: you do not need the value of your portfolio on the day of every deposit. The disadvantage: the result is less accurate with large deposits in a period when prices move a lot.5 The result is cumulative: it covers the whole period, not one year.
XIRR: the return per year from your cash flows
XIRR (IR.SCHEMA in Dutch Excel) finds the return per year at which all your cash flows add up to exactly zero. Your start value and your deposits count as money going in (negative), withdrawals and your end value as money coming out (positive). The GIPS handbook calls this the internal rate of return (IRR): the rate that makes the present value of the money going in equal to that of the money coming out.6
Σ Pi ÷ (1 + r)(di − d1) ÷ 365 = 0
Here Pi is a cash flow, di its date, d1 the date of the first cash flow and r the return per year. Excel uses a 365-day year. No formula gives r directly: Excel keeps trying a different rate until the sum works out, and returns the #NUM! error if that fails after a hundred tries.7
When deposits and withdrawals alternate, more than one rate can make the sum work out.8 And because XIRR always gives a return per year, it turns a short period into an annual figure. So only use it over at least a year.
How to enter the amounts and dates in Excel is explained step by step in Return with deposits.
Worked example: three formulas over one year
A made-up portfolio is worth €10,000 on 1 January 2025. On 1 April you deposit €6,000, on 1 October you withdraw €1,000. Exactly one year after the start, on 1 January 2026, the portfolio is worth €16,500. Your result in euros is €16,500 minus €10,000 minus your net deposit: +€1,500.
Modified Dietz: the deposit was in the portfolio for the last 275 of the 365 days, the money withdrawn was out for the last 92 days. The average invested capital is €10,000 + €6,000 × 275/365 − €1,000 × 92/365 = €14,268. The return is +€1,500 ÷ €14,268 = +10.5%.
XIRR over the same cash flows gives +10.5% per year. Over exactly one year with a few deposits, Modified Dietz and XIRR come out close together: both measure what your money earned, just in a different way.
The time-weighted return is +11.2%. For that you also need the value on the day before each deposit and withdrawal: the second and fourth rows of the table. It is higher because the first stretch of the year, up to the deposit, had the highest return of the three stretches, while the least money was invested then. Time-weighted counts every period the same, money-weighted counts a period with more money more heavily. What that difference means and when to use which is in TWR vs MWR.
The amounts and percentages in the table below are calculated by this page with the same calculation functions as the app.
| Date | Value at close | Deposit or withdrawal |
|---|---|---|
| Jan 1, 2025 (start) | €10,000 | none |
| Mar 31, 2025 | €10,400 | none |
| Apr 1, 2025 | €16,400 | +€6,000 |
| Sep 30, 2025 | €17,000 | none |
| Oct 1, 2025 | €16,000 | -€1,000 |
| Jan 1, 2026 | €16,500 | none |
| Result in euros | +€1,500 |
|---|---|
| Modified Dietz, over the year | +10.5% |
| XIRR, per year | +10.5% |
| Time-weighted return | +11.2% |
Which formula to use when
One purchase, nothing bought or deposited since: price return or total return. It is the simplest sum, and it holds as long as the purchase cost is all you put in.
Several years without deposits or withdrawals: the geometric average (CAGR). Never the plain average of your yearly returns.
A period with deposits or withdrawals: Modified Dietz. You only need the start and end values and the dates and amounts of your deposits and withdrawals. The result covers the whole period.
A return per year over several years with deposits: XIRR. It uses the exact date of every cash flow.
Comparing with an index or a fund: time-weighted return, because it ignores when you deposited money. It does need the value of your portfolio on every day with a deposit or withdrawal.
How StockQuarters calculates
For a single position, StockQuarters shows the price result on the purchase cost. Your transaction costs are included in that purchase cost, and if you bought in parts, it is everything you paid in total.
The percentage beside the result of your whole portfolio is Modified Dietz, over the period you choose. So it is cumulative. The return per calendar year on the Analytics page is also Modified Dietz on Money-weighted, over that year.
Switch the toggle to Time-weighted and StockQuarters calculates per day: today’s value divided by yesterday’s value plus today’s deposit. Those daily returns are multiplied together.
‘Average per year’ since the start is XIRR over your deposits, withdrawals and current value on Money-weighted, and the geometric average of your time-weighted return (CAGR) on Time-weighted. You see it once you have at least a year of history. With many deposits, StockQuarters groups them for XIRR per month, quarter or year, at their average date. So the result can differ by a fraction from Excel’s XIRR over the same days.
See what it looks like in the demo.
Sources
- CFA Institute, GIPS Standards Handbook for Firms (2020), provision 4.B.2: a return per year is the geometric mean, not the arithmetic mean, using the formula [(1 + R)^(1/n)] − 1. Source: gipsstandards.org/wp-content/uploads/2021/04/gips-standards-handbook-firms.pdf, checked on 22 November 2026
- GIPS Standards Handbook for Firms, provision 2.A.12: returns for periods of less than one year must not be annualised; Excel’s XIRR gives an annualised return. Source: gipsstandards.org/wp-content/uploads/2021/04/gips-standards-handbook-firms.pdf, checked on 22 November 2026
- GIPS Standards Handbook for Firms, the Modified Dietz method: the formula, and the weight of each external cash flow, (D − Dᵢ) ÷ D. Source: gipsstandards.org/wp-content/uploads/2021/04/gips-standards-handbook-firms.pdf, checked on 22 November 2026
- GIPS Standards for Firms 2020, glossary entry ‘external cash flow’: dividend and interest income payments are not external cash flows. Source: gipsstandards.org/wp-content/uploads/2021/03/2020_gips_standards_firms.pdf, checked on 22 November 2026
- GIPS Standards Handbook for Firms: Modified Dietz does not require a valuation on the date of each external cash flow, and is less accurate with large cash flows in a period of high market volatility. Source: gipsstandards.org/wp-content/uploads/2021/04/gips-standards-handbook-firms.pdf, checked on 22 November 2026
- GIPS Standards Handbook for Firms: the IRR is the rate that equates the present value of cash outflows with the present value of cash inflows. Source: gipsstandards.org/wp-content/uploads/2021/04/gips-standards-handbook-firms.pdf, checked on 22 November 2026
- Microsoft, Excel help for the XIRR function: the rate at which XNPV is zero, with payments discounted on a 365-day year, found by an iterative technique; after 100 tries without a result it returns #NUM!. Source: support.microsoft.com/en-us/office/xirr-function-de1242ec-6477-445b-b11b-a303ad9adc9d, checked on 22 November 2026
- GIPS Standards Handbook for Firms: the IRR requires an iterative solution and can have multiple answers when there are both positive and negative cash flows. Source: gipsstandards.org/wp-content/uploads/2021/04/gips-standards-handbook-firms.pdf, checked on 22 November 2026