I do this in Excel for my investments. It’s not simple. I’ll describe my setup.
Column A has dates investments were made.
Column B has the number of days between the date on that row and the date above.
Column C has the amount of money invested on the date.
Column D has, in the first row (Row 2, since Row 1 is headers), the investment amount on that first date, and for each subsequent row, the amount there will be at that date given a compounding rate. That is, it’s the size of the row above compounded for the number of days in column B plus the amount in column C for that row.
The last row has the current date (=TODAY()) in Column A and generally no investment amount.
Pick a cell that’s not being used in the above investment amounts and dates. Let’s call that D19 (since that’s what it is right now for me). Once you do that, the formula to use in Column D is, for Cell D3, “=D2*(1+D$19)^B3+C3” - note the $, which means you can fill the rest of Column D with autofill or copy/paste and change the other row numbers automatically but not D19. Then in another cell, suppose D20, you put the formula: “=(1+D19)^365-1”. D19 will be the average implied daily rate of return, and D20 is then the annual return. But I haven’t told you what to put in D19 though, because it’s not that simple.
Now go to the Data tab, in the Data Tools area choose What-If Analysis, then Goal Seek. For “Set Cell”, choose the cell in Column D in the row with today’s date (or whatever day you want to compute the rate of return through), for “To Value” put the current value of the investment (or the value on the day you want to calculate it to), and for “By changing cell” choose the cell D19 (or whatever it actually is for you). Hit OK and Excel will iterate calculations by changing D19 until the value of the end investment, as calculated by compounding the amounts of the investments after each subsequent investment, will appear in the today-dated row of Column D. As D19, the daily rate of compounding, changes, it changes D20, the annual return rate, which is what you’re looking for.
Is there an easier way? If you have an HP12C I think there’s a way to basically do the same thing as above (I’m sure my father knew exactly how to do it) but with a more primitive device with those exact calculations built into the circuitry so long as you input the dates and amounts into the registers. But that’s the calculation you need to do regardless of how you want to get the answer.
If you made the investments on a weekly or other regular schedule, you could forget about doing it by day and instead do it with a different time period as the base compounding period, but since I’m not too regular about when exactly I move my money into my investment account, I just stick to daily compounding.
For the best accuracy if the investment pays dividends, you’ll want to enter another line for the date of the dividend and put the amount of the dividend received as a negative number in Column C.