Saturday, August 13, 2016

How to use the IPMT Function (WS,VBA)

Description

The Microsoft Excel IPMT function returns the interest payment for an investment based on an interest rate and a constant payment schedule.

Syntax

The syntax for the IPMT function in Microsoft Excel is:
IPMT( interest_rate, period, number_payments, PV, [FV], [Type] )

Parameters or Arguments

interest_rate
The interest rate for the investment.
period
The period to calculate the interest rate. It must be a value between 1 andnumber_payments.
number_payments
The number of payments for the annuity.
PV
The present value of the payments.
FV
Optional. It is the future value that you'd like the investment to be after all payments have been made. If this parameter is omitted, it will assume a FV of 0.
Type
Optional. It indicates when the payments are due. If the Type parameter is omitted, it assumes a Type value of 0. Type can be one of the following values:
ValueExplanation
0Payments are due at the end of the period. (default)
1Payments are due at the beginning of the period.

Applies To

  • Excel 2016, Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000

Type of Function

  • Worksheet function (WS)
  • VBA function (VBA)

Example (as Worksheet Function)

Let's look at an example to how you would use the IPMT examples and explore how to use the IPMT function as a worksheet function in Microsoft Excel:
This first example returns the interest payment for a $5,000 investment that earns 7.5% annually for 2 years. The interest payment is calculated for the 8th month and payments are due at the end of each month.
=IPMT(7.5%/12, 8, 2*12, 5000)
Result: -$22.61
This next example returns the interest payment for a $8,000 investment that earns 6% annually for 4 years. The interest payment is calculated for the 30th week and payments are due at the beginning of each week.
=IPMT(6%/52, 30, 4*52, 8000, 0 ,1)
Result: -$8.06
This next example returns the interest payment for a $6,500 investment that earns 5.25% annually for 10 years. The interest payment is calculated for the 4th year and payments are due at the end of each year.
=IPMT(5.25%/1, 4, 10*1, 6500)
Result: -$256.50

Example (as VBA Function)

The IPMT function can also be used in VBA code in Microsoft Excel.
Let's look at some Excel IPMT function examples and explore how to use the IPMT function in Excel VBA code:
Dim LNumber As Currency

LNumber = IPmt(0.0525/1, 4, 10*1, 6500)
In this example, the variable called LNumber would now contain the value of -256.504747.