IPmt Function


IPmt Function

Class

Microsoft.VisualBasic.Financial

Syntax

     Dim result As Double = IPmt(rate, per, nPer, pv[, fv[, due]]) 


rate (required; Double)

The interest rate per period.


per (required; Double)

The period for which a payment is to be computed.


nPer (required; Double)

The total number of payment periods.


pv (required; Double)

The present value of a series of future payments.


fv (optional; Double)

The future value or cash balance after the final payment. If omitted, the default value is 0.


due (optional; DueDate enumeration)

A value indicating when payments are due, from the Microsoft.VisualBasic.DueDate enumeration. DueDate.EndOfPeriod indicates that payments are due at the end of the payment period; DueDate.BegOfPeriod indicates that payments are due at the beginning of the period. If omitted, the default value is DueDate.EndOfPeriod.

Description

The 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

  • The value of per ranges from 1 to nPer.

  • If pv and fv represent liabilities, their values are negative; if they represent assets, their values are positive.

  • rate and nPer must be expressed in the same time unit. That is, if nPer reflects the number of monthly payments, rate must be the monthly interest rate.

  • The rate is supplied as a decimal percent. For example, 10% is stated as 0.1.

Example

The 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 Also

FV Function, NPer Function, NPV Function, Pmt Function, PPmt Function, PV Function, Rate Function




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net