SYD 函数SYD function

返回一个 Double,该值指定某项资产在指定期间的年限总额折旧。Returns a Double specifying the sum-of-years' digits depreciation of an asset for a specified period.

语法Syntax

SYD(成本抢救生命__周期、期间)SYD(cost, salvage, life, period)

SYD 函数包含以下命名参数The SYD function has these named arguments:

PartPart 说明Description
低廉cost 必需。Required. 用于指定资产的原始成本的 DoubleDouble specifying initial cost of the asset.
挽救salvage 必需。Required. 用于指定资产在其使用年限结束时的价值的 DoubleDouble specifying value of the asset at the end of its useful life.
急救life 必需。Required. 用于指定资产的使用年限的长度的 DoubleDouble specifying length of the useful life of the asset.
超时period 必需。Required. 用于指定计算资产折旧的期间的 DoubleDouble specifying period for which asset depreciation is calculated.

备注Remarks

lifeperiod 参数必须用相同的单位表示。The life and period arguments must be expressed in the same units. 例如,如果以月份表示 life,则也必须以月份表示 periodFor example, if life is given in months, period must also be given in months. 所有参数都必须是正数。All arguments must be positive numbers.

示例Example

本示例使用SYD函数在给定资产的初始成本 (InitCost)、资产使用年限结束时的残值 (SalvageVal) 和资产总寿命 (以年LifeTime).This example uses the SYD function to return the depreciation of an asset for a specified period given the asset's initial cost (InitCost), the salvage value at the end of the asset's useful life (SalvageVal), and the total life of the asset in years (LifeTime). 计算折旧的期间 (以年为单位) PDeprThe period in years for which the depreciation is calculated is PDepr.

Dim Fmt, InitCost, SalvageVal, MonthLife, LifeTime, DepYear, 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 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?")
Loop
LifeTime = 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?"))
Loop
PDepr = SYD(InitCost, SalvageVal, LifeTime, DepYear)
MsgBox "The depreciation for year " & DepYear & " is " & Format(PDepr, Fmt) & "."

另请参阅See also

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.