跳到主要内容

NPER

Returns the number of periods for an investment based on periodic, constant payments and a constant interest rate.

Syntax

expression.NPER(arg1, arg2, arg3, arg4, arg5);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe interest rate per period. For example, use 6%/4 for quarterly payments at 6% APR.
arg2RequiredApiRange | ApiName | numberThe payment made each period; it cannot change over the life of the investment.
arg3RequiredApiRange | ApiName | numberTe present value, or the lump-sum amount that a series of future payments is worth now.
arg4OptionalApiRange | ApiName | numberThe future value, or a cash balance which will be attained after the last payment is made. If omitted, zero is used.
arg5OptionalApiRange | ApiName | numberA logical value: payment at the beginning of the period = 1; payment at the end of the period = 0 or omitted.

Returns

number

Example

let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.NPER(0.1/12, -500, 10000, 0));