# How to calculate annualized rate of return over multiple transactions

The annual rate of return on an investment can be calculated as

And the top response to this question suggests that the return on a portfolio of such purchases is simply the weighted average of returns on individual transactions, where the weighting coefficient is the number of shares bought:

However, by this definition, it seems like the calculated portfolio return can be positive, despite losing money.

Consider the following example: I purchase two shares of stock, one for \$100 and one for \$10, and sell both for \$50, the first held for 1 year and the second held for 0.5 years.

So I've spent \$110 and received \$100, but the calculated return is +1175% [ (-50% + 2400%)/2 ].

What am I doing wrong?

1st equation

``````R = (Pt/Po)^(1/t) - 1
``````

annualised returns for shares 1 & 2 are

``````r1 = (50/100) - 1 = -50 %

r2 = (50/10)^(1/0.5) - 1 = 2400 %
``````

2nd equation

``````R = Sum[mi*Ri]/n
``````

Calculating half-year returns corresponding to the holding periods:

"weighted average of returns on individual transactions" for each half-year

``````hr1 = (100*(1 + r1)^(1/2) + 10*(1 + r2)^(1/2))/110 - 1 = 9.73698 %

hr2 = (1 + r1)^(1/2) - 1 = -29.2893 %
``````

giving the return over the year as

``````(1 + hr1)*(1 + hr2) - 1 = -22.4042 %
``````
• Got it, thanks. For a collection of purchases with different holding periods, it looks like this calculation could become quite complex. Is internal rate of return (IRR) the best approach in this case? Commented May 6, 2020 at 23:22
• Calculation of CAGR is an IRR problem, e.g. `0 = 10 - 50/(1 + r)^0.5``r = -50%` but if you mean put all the cash flows in one IRR like so: `0 = 110 - 50/(1 + r)^0.5 - 50/(1 + r)``r = -11.875%` you get a quite different result because you are omitting certain information. The closest to reality is a time-weighted return, which you could use if you knew the value of share 1 when you sold share 2. Let's say it was \$72. Then `hr1 = (72 + 50)/(100 + 10) - 1 = 10.9%` and `hr2 = 50/72 - 1 = -30.56%` so `r = (1 + hr1)*(1 + hr2) - 1 = -22.98%`. So the approach in the answer is closer to reality. Commented May 7, 2020 at 9:07
• However, if you have numerous transactions IRR (or money-weighted return) is usually a fair enough approximation. It gets less accurate compared to time-weighted return when there are large mid-period cash flows. Commented May 7, 2020 at 9:17