DDB 函数

返回一个 Double 类型的值,它通过使用双倍余额递减法或指定的其他方法指定特定时间段内资产的折旧值。

语法

DDB (成本打捞生命周期、[ 因素 ])

DDB 函数具有以下命名参数

Part 说明
成本 必填。 指定 资产的初始成本的 Double。
打捞 必填。 在资产的使用寿命结束时指定资产的值的双精度值。
生活 必填。 指定资产的使用寿命长度的双精度值。
时期 必填。 指定计算资产折旧额的周期的双精度值。
因素 可选。 指定余额下降率的变体。 若省略它,则假定为 2(双倍余额递减法)。

备注

双倍余额递减法加速计算折旧。 折旧额在第一个期间是最高的,随后将逐个期间下降。

lifeperiod参数必须用相同的单位表示。 例如,如果以月份表示 life,则也必须以月份表示 period。 所有参数都必须是正数。

DDB 函数使用以下公式计算给定期间的折旧额:

折旧/ 期间 = ( (成本 - 挽救) * 因素) / life

示例

本示例使用 DDB 函数返回给定初始成本 () 、资产使用年限SalvageVal (InitCost) 结束时的残值、 () 年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 支持和反馈,获取有关如何接收支持和提供反馈的指南。