返回指定资产单期线性折旧的 Double。
语法
SLN (成本、报废、寿命)
SLN 函数具有以下参数:
| 参数 | 说明 |
|---|---|
| 成本 | 必需。 Double 指定资产的初始成本。 |
| Salvage | 必需。 双重 指定资产在其使用寿命结束时的价值。 |
| 生活 | 必需。 双精度 指定资产使用寿命的长度。 |
备注
折旧期必须与寿命参数以相同的单位表示。 所有参数必须为正数。
查询示例
| Expression | 结果 |
|---|---|
| SELECT SLN ([LoanAmount],[LoanAmount]*.1,20) AS Expr1 FROM FinancialSample; | 返回值为 “LoanAmount” 的资产的折旧值,残值为 10% (“LoanAmount”乘以 0.1) ,考虑资产的使用寿命为 20 年。 |
| SELECT SLN ([LoanAmount],0,20) AS SLDepreciation FROM FinancialSample; | 返回资产的折旧值为“LoanAmount”,残值为 0 美元,考虑到资产的使用寿命为 20 年。 结果将显示在 SLDepreciation 列中。 |
VBA 示例
注意
下面的示例演示了在Visual Basic for Applications (VBA) 模块中使用此函数。 有关使用 VBA 的详细信息,请在“搜索”旁边的下拉列表中选择“开发人员参考”,然后在搜索框中输入一个或多个术语。
本示例使用 SLN 函数返回资产在给定资产的初始成本 (InitCost) 、资产使用年限结束时的残值 (SalvageVal) 以及资产的总寿命(以年 (LifeTime) 为单位)计算的单期线性折旧费。
Dim Fmt, InitCost, SalvageVal
Dim MonthLife, LifeTime, PDepr
Const YEARMONTHS = 12 ' Number of months in a year.
Fmt = "###,##0.00" ' Define money format.
InitCost = InputBox("What's the initial cost " & _
"of the asset?")
SalvageVal = InputBox("What's the asset's value " & _
"at the end of its useful life?")
MonthLife = InputBox("What's the asset's useful " & _
"life in months?")
' Ensure period is >= 1 year.
Do While MonthLife < YEARMONTHS
MsgBox "Asset life must be a year or more."
MonthLife = InputBox("What's the asset's " & _
"useful life in months?")
Loop
' Convert months to years.
LifeTime = MonthLife / YEARMONTHS
If LifeTime <> Int(MonthLife / YEARMONTHS) Then
' Round up to nearest year.
LifeTime = Int(LifeTime + 1)
End If
PDepr = SLN(InitCost, SalvageVal, LifeTime)
MsgBox "The depreciation is " & _
Format(PDepr, Fmt) & " per year."