SYD 函数

更新:2007 年 11 月

返回一个 Double 数据类型值,指定某项资产在一指定期间内用年数总计法计算的折旧。

Function SYD( _
   ByVal Cost As Double, _
   ByVal Salvage As Double, _
   ByVal Life As Double, _
   ByVal Period As Double _
) As Double

参数

  • Cost
    必选。Double,指定资产的初始成本。

  • Salvage
    必选。Double,指定在使用期结束时资产的价值。

  • Life
    必选。Double,指定资产使用期的长度。

  • Period
    必选。Double,指定计算资产折旧所用的周期。

异常

异常类型

错误号

条件

ArgumentException

5

Salvage < 0、Period > Life 或 Period <=0。

如果正在升级使用无结构错误处理的 Visual Basic 6.0 应用程序,请参见“错误号”一列。(您可以根据 Number 属性(Err 对象)比较错误号。)然而,如果可能,应当考虑用 Visual Basic 的结构化异常处理概述替换这种错误控制。

备注

必须用相同的单位表示 Life 和 Period 参数。例如,如果 Life 以月为单位,则 Period 也必须以月为单位。所有参数都必须为正数。

示例

本示例使用 SYD 函数返回在指定期间内的资产折旧,假设前提包括:资产的初始成本 (InitCost)、在资产使用期结束时的残值 (SalvageVal) 以及资产的总使用期年限 (LifeTime)。

Dim InitCost, SalvageVal, LifeTime, DepYear As Double
Dim Fmt As String = "###,##0.00"

InitCost = CDbl(InputBox("What's the initial cost of the asset?"))
SalvageVal = CDbl(InputBox("Enter the asset's value at end of its life."))
LifeTime = CDbl(InputBox("What's the asset's useful life in years?"))

' Use the SLN function to calculate the deprecation per year.
Dim SlnDepr As Double = SLN(InitCost, SalvageVal, LifeTime)
Dim msg As String = "The depreciation per year: " & Format(SlnDepr, Fmt)
msg &= vbCrLf & "Year" & vbTab & "Linear" & vbTab & "Doubling" & vbCrLf

' Use the SYD and DDB functions to calculate the deprecation for each year.
For DepYear = 1 To LifeTime
    msg &= DepYear & vbTab & _
        Format(SYD(InitCost, SalvageVal, LifeTime, DepYear), Fmt) & vbTab & _
        Format(DDB(InitCost, SalvageVal, LifeTime, DepYear), Fmt) & vbCrLf
Next
MsgBox(msg)

要求

命名空间:Microsoft.VisualBasic

**模块:**Financial

**程序集:**Visual Basic 运行库(在 Microsoft.VisualBasic.dll 中)

请参见

参考

DDB 函数

SLN 函数

财务摘要

ArgumentException