返回一个 Double 值,指定指定期间资产的年总和折旧。
语法
SYD ( 成本、打捞、生命、周期 )
SYD 函数语法具有以下参数:
|
参数 |
说明 |
|
成本 |
必需。 双重 指定资产的初始成本。 |
|
打捞 |
必需。 在 资产的使用寿命结束时指定其值。 |
|
使用时间 |
必需。 指定资产的使用寿命长度的双精度值。 |
|
时期 |
必需。 指定计算资产折旧额的周期的双精度值。 |
备注
life 和 period 参数必须以相同的单位表示。 例如,如果 生命 以月为单位,则 周期 也必须以月为单位。 所有参数都必须是正数。
查询示例
|
Expression |
结果 |
|
SELECT SYD ([LoanAmount],[LoanAmount]*.1,20,2) AS Expr1 FROM FinancialSample; |
计算价值为“LoanAmount”的资产的折旧值,将“LoanAmount”的残值 ( 10% 乘以 0.1) ,并考虑该资产的使用寿命为 20 年。 折旧计算第二年。 |
|
SELECT SYD ([LoanAmount],0,20,3) AS SLDepreciation FROM FinancialSample; |
返回价值为“LoanAmount”的资产的折旧值,其残值为 0 美元,考虑到该资产的使用寿命为 20 年。 结果显示在 SLDepreciation 列中。 折旧计算第三年。 |
VBA 示例
注意: 下面的示例演示了如何在 Visual Basic for Applications (VBA) 模块中使用此函数。 有关使用 VBA 的详细信息,请在搜索旁边的下拉列表中选择“开发人员参考”,并在搜索框中输入一个或多个术语。
此示例使用 SYD 函数返回给定资产的初始成本 (InitCost) 、资产使用年限 (SalvageVal) 结束时的剩余值以及资产的总生命周期(以年为单位 (LifeTime) )的折旧值。 计算折旧额的年数为 PDepr。
Dim Fmt, InitCost, SalvageVal, MonthLife, LifeTime, DepYear, PDeprConst 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 life?")MonthLife = InputBox("What's the asset's useful life in months?")Do While MonthLife < YEARMONTHS ' Ensure period is >= 1 year. MsgBox "Asset life must be a year or more." MonthLife = InputBox("What's the asset's useful life in months?")LoopLifeTime = MonthLife / YEARMONTHS ' Convert months to years.If LifeTime <> Int(MonthLife / YEARMONTHS) Then LifeTime = Int(LifeTime + 1) ' Round up to nearest year.End If DepYear = CInt(InputBox("For which year do you want depreciation?"))Do While DepYear < 1 Or DepYear > LifeTime MsgBox "You must enter at least 1 but not more than " & LifeTime DepYear = CInt(InputBox("For what year do you want depreciation?"))LoopPDepr = SYD(InitCost, SalvageVal, LifeTime, DepYear)MsgBox "The depreciation for year " & DepYear & " is " & Format(PDepr, Fmt) & "."