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:
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. |
[Fv] | - |
An optional argument that specifies the future value of the loan / investment. If omitted, [Fv] uses the default value 0. |
[Due] | - |
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; 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.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.
Dim mthlyPmt As Double' Interest is 5% per year and payments are made at the end of the month. 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:
If the supplied Nper is equal to 0, the VBA Pmt function produces the error: