1. ## Loan formula

Hi,

I am very new to financial mathematics and I am looking for a loan formula to calculate a loan.
I am writing a script (in Perl) to calculate leasing offers out of a price where you got a 10% scrap value (after the end of the contract you can buy the car for 10% of its original value).

The problem is that the formulas (that i can find at least) do not have the FV (future value ) included in it and this is part of my needs. I found a perl module Math::Financial but this does not support the FV parameter in the loan calculation. In Open/Libre Office there is an existent function called PMT that does the trick but I need the actual formula behind that.

2. ## Re: Loan formula

The PMT function calculates the periodic payment to pay off the loan in full.
Formula is:
P = Ai / (1 - v) where v = 1/(1 + i)^n

P = periodic payment
A = Amount borrowed
i = periodic interest rate
n = number of periods

In most cases, the payment frequency is monthly.

As example, \$15,000 is borrowed; 12% annual compounded monthly; 36 months:
P = 15000(.01) / [1 - 1/(1.01)^36] = 498.2146.....

3. ## Re: Loan formula

Apparently I did not explained it correctly ...

I got :

rate (IR) - duration (N) - initial amount (PV) - scrap value (FV)

I need payment (PMT)

4. ## Re: Loan formula

Originally Posted by elfranne
Apparently I did not explained it correctly ...
I got :
rate (IR) - duration (N) - initial amount (PV) - scrap value (FV)
I need payment (PMT)
The formula I gave you is for regular loans...

You stated:
"In Open/Libre Office there is an existent function called PMT
that does the trick but I need the actual formula behind that."
Please supply an example of input and output.

Apart from that, your problem as stated is unclear; like,
is a "loan" really involved? Is the FV a balance owing on
this loan, or is the loan first reduced to zero, then car sold?

5. ## Re: Loan formula

BUT...if the objective is to calculate the payment (lease) on a loan where a known
amount (scrap value) remains owing after nth payment, then formula is:

P = i[A(1 + i)^n - S] / [(1 + i)^n - 1]

P = periodic payment
A = Amount borrowed
S = Scrap value (known as balloon payment)
i = periodic interest rate
n = number of periods

A simple example: loan of 5000, 12%, 36 months, scrap value 1000; comparing:
Code:
    PAYMENT  INTEREST   BALANCE    PAYMENT  INTEREST   BALANCE
00                      5000.00                        5000.00
01 -166.07    50.00     4883.93    -142.85   50.00     4907.15
...
36 -166.07     1.64         .00    -142.85   11.32     1000.00

6. ## Re: Loan formula

Originally Posted by elfranne
Apparently I did not explained it correctly ...

I got :

rate (IR) - duration (N) - initial amount (PV) - scrap value (FV)

I need payment (PMT)
Most spreadsheet programs like MS Excel make use of an equation to find the five TVM or time value of money functions

PV (1+IR)^N + PMT(1+IR * TYPE) [{(1+IR)^N} - 1]/IR + FV = 0

TYPE is 0 for end of payments as in ordinary annuity e.g. mortgage payments
TYPE is 1 for start of payments as in annuity due e.g. rent payments, lease payments

So the PMT is singled out on the left hand side of the equation

PMT = (-FV - PV * fvif(IR,N)) / (fvifa(IR,N) * (1.0+TYPE*IR))

fvif(IR,N) = (1+IR)^N
fvifa(IR,N) = [{(1+IR)^N} - 1 ]/IR

You can try this PMT calculator to see if you get the correct payment before you implement this formula in Perl

7. ## Re: Loan formula

Originally Posted by Wilmer
P = i[A(1 + i)^n - S] / [(1 + i)^n - 1]
That was exactly what i was looking for. Sorry for being unclear about the info I gave you, because I am myself quite unclear on how it has to be because i have nearly never done any financial math ...

Going to try to use it on my perl script now ...

Thanks a lot