# NPer 函数NPer Function

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

pmtpmt必填。 双精度指定付款进行每个期间。付款金额通常包含本金和利息，该值在年金的周期不会改变。Required. Double specifying payment to be made each period. Payments usually contain principal and interest that doesn't change over the life of the annuity.
pvpv必填。 Double数据类型现值，即一系列未来付款或收入的当日，价值。例如，您借钱买车，贷款金额时，对贷方而言您按月付款的现值。Required. Double specifying present value, or value today, of a series of future payments or receipts. For example, when you borrow money to buy a car, the loan amount is the present value to the lender of the monthly car payments you will make.
fvfv可选。变量指定最后一次付款后所希望的终值或现金余额。例如，一笔贷款的未来值是 0 美元，因为这是最后一次付款后它的值。但是，如果您想要保存为孩子的教育经费超过 18 年的 50000 美元，\$50000 是未来值。如果省略，则假定为 0。Optional. Variant specifying future value or cash balance you want after you've made the final payment. For example, the future value of a loan is \$0 because that's its value after the final payment. However, if you want to save \$50,000 over 18 years for your child's education, then \$50,000 is the future value. If omitted, 0 is assumed.

## 示例Example

``````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."
``````