SYD 函數

回傳一個雙 重, 指定資產在指定期間內的年數總和折舊。

語法

SYD (成本、殘骸、生命、)

SYD 函式具有以下命名參數:

部分 描述
成本 此為必要動作。 雙重 指定資產的初始成本。
打撈 此為必要動作。 雙重 指定資產在其使用壽命結束時的價值。
生平 此為必要動作。 雙重 指定資產的使用壽命長度。
就這樣 此為必要動作。 雙重 指定計算資產折舊的期間。

註解

生命與時代論證必須以相同的單位表達。 例如,如果 生命 以月份計算, 那麼週期 也必須以月份計算。 所有參數必須為正數。

範例

此範例使用 SYD 函數,根據資產初始成本 () InitCost 、資產) (SalvageVal 使用壽命結束時的殘值,以及資產 (LifeTime 年) 年,在特定期間內的折舊結果。 計算 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) & "."

另請參閱

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。