Financial.IPmt(Double, Double, Double, Double, Double, DueDate) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回一个值,该值根据定期、固定付款和固定利率指定给定年金期的利息付款。
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 到 NPer1 的付款期。
- NPer
- Double
必填。 年金中的付款期总数。 例如,如果你每月支付四年期汽车贷款,你的贷款总共有 4 x 12 (或 48) 付款期。
- PV
- Double
必填。 一系列未来付款或收据的现值或当前值。 例如,当你借钱买车时,贷款金额是贷款人每月支付汽车付款的现值。
- FV
- Double
Optional. 完成最终付款后所需的未来价值或现金余额。 例如,贷款的未来值为 \$0,因为这是最终付款后的值。 但是,如果你想节省 \$50,000 超过 18 年的子女教育,那么 \$50,000 是未来的价值。 如果省略,则假定为 0。
- Due
- DueDate
Optional. 指定付款到期时间的类型 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
注解
年金是一系列固定现金支付随着时间的推移。 年金可以是贷款 (,如住房抵押贷款) 或投资 (,如每月储蓄计划) 。
Rate必须使用以相同单位表示的付款期计算参数和NPer参数。 例如,如果使用 Rate 月份计算, NPer 则还必须使用月份计算。
对于所有参数,现金支付 (如存款到储蓄) 用负数表示:收到的现金 ((如股息检查) )由正数表示。