NPer 函数

Returns a Double specifying the number of periods for an annuity based on periodic, fixed payments and a fixed interest rate.

语法

NPer (ratepmtpv,[ fv, [ type ]])

“NPer”函数包含以下命名参数

Part 说明
必填。 指定每个周期的利率的 Double。 例如,如果您获得了年利率 (APR) 为 10% 的汽车贷款并进行月供,则每期利率为 0.1/12 或 0.0083。
Pmt 必填。 指定每个月的付款的“Double”。 付款通常包含了在该年金时期间不会改变的本金和利息。
光伏 必填。 指定一系列未来付款或回执的现值或当前值的“Double” 。 例如,当你借钱买车时,贷款金额是贷款人每月支付汽车付款的现值。
抗体 可选。 指定在完成最后付款后所需的未来值或现金余额的 Variant。 例如,贷款的未来值为 $0,因为这是完成最后付款后的值。 但是,如果要在 18 年内节省 50,000 美元用于孩子的教育,则 50,000 美元是未来价值。 如果省略了,便假设为 0。
type 可选。 指定付款的到期时间的 Variant。 如果付款在付款期结束时到期,则使用 0;如果付款在付款期开始时到期,则使用 1。 如果省略,则假定为 0。

备注

年金是一段时间内一系列的固定的现金付款。 年金可以是贷款(如房产抵押),也可以是投资(如月存款计划)。

对于所有参数,支出的现金(如储蓄的存款)由负数表示;收入的现金(如股息支票)由正数表示。

示例

This example uses the NPer function to return the number of periods during which payments must be made to pay off a loan whose value is contained in PVal. 还提供了每期 () APR / 12 的利率百分比、付款 () Payment 、贷款 (FVal) 的未来价值,以及一个数字,指示付款期的开始或结束时是到期的 () PayType

Dim FVal, PVal, APR, Payment, PayType, TotPmts
Const ENDPERIOD = 0, BEGINPERIOD = 1    ' When payments are made.
FVal = 0    ' Usually 0 for a loan.
PVal = InputBox("How much do you want to borrow?")
APR = InputBox("What is the annual percentage rate of your loan?")
If APR > 1 Then APR = APR / 100    ' Ensure proper form.
Payment = InputBox("How much do you want to pay each month?")
PayType = MsgBox("Do you make payments at the end of month?", vbYesNo)
If PayType = vbNo Then PayType = BEGINPERIOD Else PayType = ENDPERIOD
TotPmts = NPer(APR / 12, -Payment, PVal, FVal, PayType)
If Int(TotPmts) <> TotPmts Then TotPmts = Int(TotPmts) + 1
MsgBox "It will take you " & TotPmts & " months to pay off your loan."

另请参阅

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。