返回 Double 值,使用双倍余额递减法或指定的其他某种方法指定特定时间段的资产折旧值。
语法
DDB ( 成本、残值、生命周期、期间 [, 因素])
DDB函数语法具有以下参数:
参数 |
说明 |
成本 |
必需。 Double 指定资产的初始成本。 |
salvage |
必需。 在 资产使用寿命结束时双击指定资产的值。 |
life |
必需。 Double 指定资产的有用生命周期长度。 |
period |
必需。 计算 资产折旧的双倍指定周期。 |
factor |
可选。 变量指定余额下降的速率。 如果省略,则 (双倍) 2。 |
备注
双倍余额递减法以加速的比率计算折旧。 折旧在第一阶段是最高的,在后继阶段中会减少。
生命周期和期间参数必须以相同的单位表示。 例如,如果 以月 表示生命, 则周期 也必须以月表示。 所有参数必须为正数。
DDB函数使用以下公式计算给定时段的折旧值:
折旧/ 期间 = ( (成本 – salvage) * factor) /life
示例
注意: 以下示例演示了在 VBA Visual Basic for Applications (模块) 函数。 有关使用 VBA 的信息,请在"搜索"旁边的下拉列表中选择"开发人员参考",在搜索框中输入一个或多个术语。
此示例使用 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) & "."