DDB 函數

會傳回 Double ,指定資產在特定時段的折舊,方法是使用雙重餘額遞減方法或您指定的一些其他方法。

語法

DDB (成本回收生命週期、[ 因素 ])

DDB函式具有下列命名引數

部分 描述
成本 此為必要動作。 精度浮點數指定資產的初始成本。
打撈 此為必要動作。 精度浮點數指定資產在使用年限結束時的值。
生活 此為必要動作。 精度浮點數指定資產的使用年限長度。
時期 此為必要動作。 精度浮點數指定資產折舊計算的期間。
因素 選用。 Variant 指定餘額減少的速率。 如果省略,則會假設有 2 個 (雙遞減方法) 。

註解

倍率餘額遞減法是加速折舊法的一種。 這種方法的第一期折舊最高,然後依次遞減。

lifeperiod 自變必須以相同的單位表示。 例如,如果 生命 週期是以月為單位, 則期間 也必須以月為單位。 所有引數都必須是正數。

DDB函式會使用下列公式來計算指定期間的折舊:

折舊 /週期= ( (成本 - 回收) *因素) /生命週期

範例

這個範例會使用 DDB 函式傳回指定期間內資產的折舊,指定初始成本 () InitCost 、資產實用生命週期結束時的回收值 () SalvageVal 、資產在年份 () LifeTime 的總生命週期,以及 () 計算 Depr 折舊的年份。

Dim Fmt, InitCost, SalvageVal, MonthLife, LifeTime, DepYear, Depr
Const YRMOS = 12    ' Number of months in a year.
Fmt = "###,##0.00"
InitCost = InputBox("What's the initial cost of the asset?")
SalvageVal = InputBox("Enter the asset's value at end of its life.")
MonthLife = InputBox("What's the asset's useful life in months?")
Do While MonthLife < YRMOS    ' 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 / YRMOS    ' Convert months to years.
If LifeTime <> Int(MonthLife / YRMOS) Then
    LifeTime = Int(LifeTime + 1)    ' Round up to nearest year.
End If 
DepYear = CInt(InputBox("Enter year for depreciation calculation."))
Do While DepYear < 1 Or DepYear > LifeTime
    MsgBox "You must enter at least 1 but not more than " & LifeTime
    DepYear = InputBox("Enter year for depreciation calculation.")
Loop
Depr = DDB(InitCost, SalvageVal, LifeTime, DepYear)
MsgBox "The depreciation for year " & DepYear & " is " & _
Format(Depr, Fmt) & "."

另請參閱

支援和意見反應

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