TRY NEW VERSION

DURATION

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

Returns the annual duration of a security with periodic interest payments.

Parameters:

Name Type Description
arg1 any

Is the security's settlement date, expressed as a serial date number.

arg2 any

Is the security's maturity date, expressed as a serial date number.

arg3 any

Is the security's annual coupon rate.

arg4 any

Is the security's annual yield.

arg5 any

Is the number of coupon payments per year.

arg6 any

Is the type of day count basis to use.

Returns:

Type
number | string | boolean

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
oWorksheet.GetRange("A1").SetValue(oFunction.DURATION("1/10/2018", "6/15/2019", 0.08, 0.09, 4, 1));
builder.SaveFile("xlsx", "DURATION.xlsx");
builder.CloseFile();

Resulting document