# Check my math - Compound Interest

I recently calculated how long it would take to pay off a loan, and I would like to have someone check my math to make sure I'm doing it right.

I used the formula below: (i = APR/12, b = total balance due today, p = monthly payment amount)

n = ln((1 - i) * (b / p)) / ln(1 + i)


to calculate how many payments it would take to pay off the loan. Is this formula correct?

Also, there are multiple loans with different interest rates that I want to calculate how long the payoff would take overall. Would summing the balances together and taking the mean of the interest rates provide an accurate calculation with the above formula?

This isn't homework, I'm doing this calculation for real-world purposes.

-

But no, if you have several loans you can't just average the balances and interest rates. If they are not too different it will not be far off. It will depend upon which loans you repay first, and you should repay the highest interest ones first. For an extreme example, suppose you have borrowed \$1 at 100%/day=36500%/year and \$1,000,000 at no interest. The average interest rate (dollar averaged) is small. But if you pay on the million dollar loan for 20 days, the other loan will be larger and you will never get out.
Instead of using the mean of the interest rates x,y, use $ln(e^{(1+0.01x)+(1+0.01y)})$. –  Angela Richardson Sep 10 '11 at 4:35