ClassMicrosoft.VisualBasic.Financial SyntaxDim result As Double = IPmt(rate, per, nPer, pv[, fv[, due]])
DescriptionThe IPmt function computes the interest payment for a given period of an annuity, based on regular fixed payments and a fixed interest rate. An annuity is a series of fixed cash payments made over a period of time. It can be either a loan or an investment. Usage at a Glance
ExampleThe ComputeSchedule function accepts a loan amount, an annual interest rate, and a number of payment months. It uses the IPmt and PPmt functions to calculate the interest and principal per month, and it returns an array of all interest and principal payments. Public Structure PaymentData Public WhichPayment As Integer Public Interest As Double Public Principal As Double End Structure Public Function ComputeSchedule(ByVal amount As Double, _ ByVal rate As Double, ByVal periods As Integer) _ As PaymentData( ) Dim periodScan As Integer Dim allPayments(0 To periods - 1) As PaymentData For periodScan = 1 To periods With allPayments(periodScan - 1) .WhichPayment = periodScan .Interest = IPmt(rate / 12, periodScan, periods, -amount) .Principal = PPmt(rate / 12, periodScan, periods, -amount) End With Next periodScan Return allPayments End Function See AlsoFV Function, NPer Function, NPV Function, Pmt Function, PPmt Function, PV Function, Rate Function |