Time Value of Money.
Notice: Negative value for owed balance and money paid to the account, positive values for balances in your favor and withdrawn from the accoont.
Basic financial formulars:
CF=Compound frequency, PF=payment frequency, X=1 for beginning of period payment otherwise 0, i=effective interest
Financial equation: (General)
(1): (PV+PMT(1+iX)/i)((1+i)^NP-1)+PV+FV=0
by using:
(2): A=(1+i)^NP-1
(3): B=(1+iX)/i
you get:
(4): (PV+PMT*B)*A+PV+FV=0
which solved for the other variable gives:
(5): NP=log((PMT*B-FV)/(PMT*B+PV))/log(1+i)
(6): PV=-(FV+A*PMT*B)/(A+1)
(7): PMT=-(FV+PV(A+1))/(A*B)
(8): FV=-(PV+A(PV+PMT*B)).
(9): IR solved by iteration