For example:
Company X shares in 2016 - 38 USD
5 years later, in 2021 - 66.95 USD
38 + 12% (4.56 USD) + 12% (5.10 USD) + 12% (5.72 USD) + 12% (6.40 USD) + 12% (7.17 USD) = 66.95 USD
What formula should I use to know that the average compound interest is 12% for each year?
We have:
$38(1+0.12)^5=66.96$
The general formula is:
$S=S_1(1+i)^n$
Where $S_1$ is initial investment, i is interest rate and n is number of years for investment. Total compound interest rate is:
$I=(1+0.12)^5-1=0.762$
The average rate of interest is:
$\frac{0.762}5=0.152=15.2$%