The VBA Pmt Function

Related Functions:


The VBA Pmt function calculates the constant periodic payments required to pay a loan or investment that has a fixed interest rate.

The syntax of the function is:

Pmt( Rate, Nper, Pv, [Fv], [Due] )

Where the function arguments are:

Rate-The interest rate, per period.
Nper-The number of periods over which the loan or investment is to be paid.
Pv-The present value of the loan / investment.

An optional argument that specifies the future value of the loan / investment.

If omitted, [Fv] uses the default value 0.


An optional argument that defines whether the payment is due at the start or the end of the period.

The [Due] argument can have the value 0 or 1, meaning:

0   -   the payment is due at the end of the period;
1   -   the payment is due at the beginning of the period.

If the [Due] argument is omitted, it uses the default value 0 (denoting payments due at the end of the period).

Cash Flow Sign Convention:

Note that, in line with the general cash flow sign convention, cash outflows are represented by negative numbers and cash inflows are represented by positive numbers.
This is seen in the example below.

VBA Pmt Function Example

In the following VBA code, the VBA Pmt function is used to calculate the monthly payments on a loan of $50,000 which is to be paid off in full after 5 years. Interest is charged at a rate of 5% per year and the loan payments are made at the end of each month.

' Calculate the monthly payments to a loan that is to be paid in full over 5 years.
' Interest is 5% per year and payments are made at the end of the month.
Dim mthlyPmt As Double
mthlyPmt = Pmt( 0.05/12, 60, 50000 )
' mthlyPmt is calculated to be -943.56168220055.

The above VBA code calculates that a monthly payment of $943.56 is required, to pay off the loan in full over 5 years.

Note that:

VBA Pmt Function Error

If the supplied Nper is equal to 0, the VBA Pmt function produces the error:

Run-time error '5': Invalid procedure call or argument

VBA Run Time Error 5 Message Box