SLN
Returns the straight-line depreciation of an asset for one period.
Syntax
expression.SLN(arg1, arg2, arg3);
expression
- A variable that represents a ApiWorksheetFunction class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
arg1 | Required | ApiRange | ApiName | number | The initial cost of the asset. | |
arg2 | Required | ApiRange | ApiName | number | The salvage value of the asset at the end of its lifetime. | |
arg3 | Required | ApiRange | ApiName | number | The number of periods over which the asset is being depreciated (sometimes called the useful life of the asset). |
Returns
number
Example
- Code
- Result
let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.SLN(3500, 500, 5));