The compound interest formula is given by:
Where
P = principal amount (the initial amount you borrow or deposit)
r = annual rate of interest (as a decimal)
t = number of years the amount is deposited or borrowed for.
A = amount of money accumulated after n years, including interest.
n = number of times the interest is compounded per year
To solve for t......
First divide both sides by P
Now, take the log of both sides....this will give us
log (A/P) = log (1 + r/n)nt
And by a property of logs, we can bring the (nt) "out front," and we can write
log (A/P) = (nt)* log (1 + r/n) ........ Now divide both sides by n and log(1 + r/n)
So we have
[log (A/P)] / [n * log(1 + r/n] = t
And that's what "t" is