A couple of weeks back. I had a question in an assignment relating to a financial function used to calulate the interest rate. I'm sure some of you have seen it before but here it is:
r = 100 ( ( y / P) ^ (1 / n) - 1 )
Where:
r = the interest rate
y = the yield (final amount)
P = principle (initial amount)
n = number of interest payments
I then re - arranged the formula to make n the subject:
n = ln (y / p) / ln (1 + i / 100)
However I have ran into a problem. If you have a problem whereby you want to calculate the number of payments to pay off a debt, the function fails.
Say for example:
How many payments to pay off a debt of £1000 at 4% interest.
The final value will obviously be 0
the interest 4%
and the inital value 1000
n = ln (0 / 1000) / ln (1 + 4 / 100)
n = ln (0) / ln (1.04)
The problems is the ln (0). As you tend towards 0 the reuslt of ln (0) will tend towards infinity. Causing the calculation to fail.
Does anyone know how I modify the formula to incorporate this? - or have a formula which can calculate the number of payments.