TRY NEW VERSION

SLN

SLN(arg1, arg2, arg3) → { number | string | boolean }

Returns the straight-line depreciation of an asset for one period.

Parameters:

Name Type Description
arg1 number

Is the initial cost of the asset.

arg2 number

Is the salvage value at the end of the life of the asset.

arg3 number

Is the number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).

Returns:

Type
number | string | boolean

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
oWorksheet.GetRange("A1").SetValue(oFunction.SLN(3500, 500, 5));
builder.SaveFile("xlsx", "SLN.xlsx");
builder.CloseFile();

Resulting document