I am attempting to solve a compound interest calculation for time given

Principal = 100
Time(years) = t
Rate(per year) = 8%
Deposit(per month) = 5
Total = 300

I can find solving for time without regular deposits. Can anyone help me out with a source or a workup of how to do this calculation with a regular monthly deposit?


I'm attempting to use this calculator but it does not allow for deposits. That is essentially what i need but with deposits.


1 Answer 1


Look this is just a geometric sum:

Assume interest is paid monthly at rate $r = 0.08/12$ (you can use the exact monthly equivalent if you want) and let $x_n = $total after $n$ months (including that month's interest and deposit).

So $x_0= 100$ and $x_{n+1} = x_n(1+r) + d$, where $d = 5$ is your deposit amount (added at the end of the month).

Applying the recursion repeatedly you see $$ x_n = x_0(1+r)^n + d(1+r)^{n-1} + \ldots + d = x_0(1+r)^n + d\sum_{j=0}^{n-1}(1+r)^j. $$ After applying the geometric sum formula you get $$ x_n = x_0(1+r)^n + \frac{d}{r}((1+r)^n-1). $$

Thus (assuming my metaphorical back-of-envelope calculation is right): $$ (1+r)^n = \frac{x_n + \gamma}{x_0 + \gamma}, $$ where $\gamma = d/r$. Take log of both sides to get $$ n = \log\left(\frac{x_n + \gamma}{x_0 + \gamma}\right)/\log(1+r). $$ I.e. to get the number of months to reach 300 you would take $x_n =300$ here and round $n$ upto the next integer.

It is 32 months for your example.

You could easily modify this so that your deposits increase over time, interest is paid yearly, etc.


Not the answer you're looking for? Browse other questions tagged or ask your own question.