Your Question trigged a lot of activity! In my reply to Qarel I forgot to mention that my Windows Vortex Program calculates the Time Averaged Simple Investment and then this is used to calculate the Annualised Yield:
The program also gives the Accumulated Investment(Account Window) as per
Iacc=(I1+I2+I3...etc) with the withdrawals being negative investments. This can easily be divided by the number of shares you have and this give the average purchase price. By adding the Accumulated Trade Cost(and other cost components) you get a more realistic Cost/Share.
With the Excel Vortex Spread Sheets, that you originally made up for me, I do essentially the same. I have added columns for trade costs, account cost, interest earnings, etc., and then I can calculate any type of average I want. I have even, at times, used Trading Cost as the average investment that creates the Extra Yield beyond the Buy and Hold Yield. This gives you a powerful metric(as Qarel calls it) to compare the AIM Annualised Profit(AAP) relative to the Buy and Hold Annualised Profit(BHAP):
(AAP-BHAP)/(Extra Trading Cost)*100%
If this is negative over the long run you are doing something wrong! This formula also shows, very powerfully, the very high leverage effect of the small additional trade cost investment.
How many ways you want to know how to skin the AVERAGE CAT?