TRY NEW VERSION

NPER

NPER(arg1, arg2, arg3, arg4, arg5) → { number | string | boolean }

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

Parameters:

Name Type Description
arg1 number

Is the interest rate per period. For example, use 6%/4 for quarterly payments at 6% APR.

arg2 number

Is the payment made each period; it cannot change over the life of the investment.

arg3 number

Is the present value, or the lump-sum amount that a series of future payments is worth now.

arg4 number

Is the future value, or a cash balance you want to attain after the last payment is made. If omitted, zero is used.

arg5 number

Is a logical value: payment at the beginning of the period = 1; payment at the end of the period = 0 or omitted.

Returns:

Type
number | string | boolean

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
oWorksheet.GetRange("A1").SetValue(oFunction.NPER(0.1/12, -500, 10000, 0));
builder.SaveFile("xlsx", "NPER.xlsx");
builder.CloseFile();

Resulting document