Financial.IPmt(Double, Double, Double, Double, Double, DueDate) 方法

定義

傳回值,指定根據定期、定額付款及固定利率所計算的年金在給定之期間內的利息付款。

public static double IPmt (double Rate, double Per, double NPer, double PV, double FV = 0, Microsoft.VisualBasic.DueDate Due = Microsoft.VisualBasic.DueDate.EndOfPeriod);
static member IPmt : double * double * double * double * double * Microsoft.VisualBasic.DueDate -> double
Public Function IPmt (Rate As Double, Per As Double, NPer As Double, PV As Double, Optional FV As Double = 0, Optional Due As DueDate = Microsoft.VisualBasic.DueDate.EndOfPeriod) As Double

參數

Rate
Double

必要。 每期利率。 例如,如果您的汽車貸款年利率 (APR) 為 10% 並採月付方式償還,則每期的利率為 0.1/12,也就是 0.0083。

Per
Double

必要。 在 1 到 NPer 範圍內的付款期間。

NPer
Double

必要。 年金中付款的總期數。 例如,如果您的四年期汽車貸款是採月付方式償還,則付款總期數就是 4 x 12 (即 48) 期。

PV
Double

必要。 一系列未來付款或收款之現值或今天的價值。 例如,當您貸款買車時,貸款金額就是您要以每月支付方式付給貸方的車款金額現值。

FV
Double

選擇性。 您在最後一次付款之後想要的未來價值或現金餘額。 例如,貸款的未來值為 $0,因為那是它在最後一期付款之後的值。 然而,如果您想在 18 年內存下美金 $50,000 元做為子女教育費用,那麼美金 $50,000 元就是未來值。 如果省略,則假設為 0。

Due
DueDate

選擇性。 DueDate 類型的物件,指定付款何時到期。 這個引數必須是 DueDate.EndOfPeriod (若付款期限是付款期間的結束日),或 DueDate.BegOfPeriod (若付款期限是付款期間的開始日)。 如果省略,則假設為 DueDate.EndOfPeriod

傳回

根據定期、定額付款及固定利率所計算的年金在給定之期間內的利息付款。

例外狀況

Per<= 0 或 Per>NPer

範例

此範例會 IPmt 使用 函式來計算當所有付款都相等值時,有多少付款是利息。 假設是每個期間 () APR / 12 的利率百分比, (Period) 、付款 () 總數 TotPmts 、貸款 ( (的現值或) 主體 PVal 、貸款 () 的未來值 FVal ,以及指出付款在付款期間 PayType 開始或結束 () 的付款期間。

Sub TestIPMT()
    Dim APR, PVal, Period, IntPmt, TotInt, TotPmts As Double
    Dim PayType As DueDate
    Dim Response As MsgBoxResult

    ' Usually 0 for a loan.
    Dim Fval As Double = 0
    ' Define money format.
    Dim Fmt As String = "###,###,##0.00"
    PVal = CDbl(InputBox("How much do you want to borrow?"))
    APR = CDbl(InputBox("What is the annual percentage rate of your loan?"))
    If APR > 1 Then APR = APR / 100 ' Ensure proper form.
    TotPmts = CInt(InputBox("How many monthly payments?"))
    Response = MsgBox("Do you make payments at end of the month?", MsgBoxStyle.YesNo)
    If Response = MsgBoxResult.No Then
        PayType = DueDate.BegOfPeriod
    Else
        PayType = DueDate.EndOfPeriod
    End If
    For Period = 1 To TotPmts   ' Total all interest.
        IntPmt = IPmt(APR / 12, Period, TotPmts, -PVal, Fval, PayType)
        TotInt = TotInt + IntPmt
    Next Period

    ' Display results.
    MsgBox("You will pay a total of " & Format(TotInt, Fmt) & 
        " in interest for this loan.")
End Sub

備註

年金是一系列經過一段時間的固定現金付款。 年金可以是貸款 (,例如家庭) 或投資 (,例如每月節省方案) 。

RateNPer 自變數必須使用以相同單位表示的付款期間來計算。 例如,如果使用 Rate 月份計算, NPer 也必須使用月份來計算。

對於所有自變數,支付的現金 (例如儲存) 的現金會以負數表示;收到現金 (,例如正數表示) 的除數檢查。

適用於

另請參閱