返回一个 Double 类型的值,它使用双倍余额递减法或指定的其他方法指定特定时间段内资产的折旧值。
语法
DDB ( 成本、打捞、生命、周期 [、 因素] )
DDB 函数语法具有以下参数:
|
参数 |
说明 |
|
成本 |
必需。 双重 指定资产的初始成本。 |
|
打捞 |
必需。 在 资产的使用寿命结束时指定其值。 |
|
使用时间 |
必需。 指定资产的使用寿命长度的双精度值。 |
|
时期 |
必需。 指定计算资产折旧额的周期的双精度值。 |
|
因素 |
可选。 指定余额下降率的变体。 如果省略,则假定使用 2 (双下降方法) 。 |
备注
双倍余额递减法以加速的比率计算折旧。 折旧在第一阶段是最高的,在后继阶段中会减少。
life 和 period 参数必须以相同的单位表示。 例如,如果 生命 以月为单位,则 周期 也必须以月为单位。 所有参数都必须是正数。
DDB 函数使用以下公式计算给定周期的折旧:
折旧/ 期间 = ( (成本 – 打捞) * 因素) / 生命
示例
注意: 以下示例演示了如何在 Visual Basic for Applications (VBA) 模块中使用此函数。 有关使用 VBA 的详细信息,请在搜索旁边的下拉列表中选择“开发人员参考”,并在搜索框中输入一个或多个术语。
此示例使用 DDB 函数返回给定初始成本 (InitCost) 、资产使用年限 (SalvageVal) 结束时的剩余值、 (LifeTime) 年资产的总生命周期以及计算折旧 (Depr) 的年份的折旧。
Dim Fmt, InitCost, SalvageVal, MonthLife, LifeTime, DepYear, DeprConst 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?")LoopLifeTime = 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.")LoopDepr = DDB(InitCost, SalvageVal, LifeTime, DepYear)MsgBox "The depreciation for year " & DepYear & " is " & _Format(Depr, Fmt) & "."