DDB 函数DDB function

返回一个double , 它使用双倍余额递减法或其他指定方法来指定特定时间段内资产的折旧值。Returns a Double specifying the depreciation of an asset for a specific time period by using the double-declining balance method or some other method you specify.

语法Syntax

DDB(成本抢救生命周期、[因子])DDB(cost, salvage, life, period, [ factor ])


DDB 函数具有以下命名参数The DDB function has these named arguments:

PartPart 说明Description
低廉cost 必需。Required. 指定资产的初始成本的双精度型Double specifying the initial cost of the asset.
挽救salvage 必需。Required. **** 在其使用寿命结束时指定资产的价值。Double specifying the value of the asset at the end of its useful life.
急救life 必需。Required. 指定资产使用年限的长度的doubleDouble specifying the length of useful life of the asset.
超时period 必需。Required. 指定计算资产折旧的时段的doubleDouble specifying the period for which asset depreciation is calculated.
决定factor 可选。Optional. 指定余额下降比率的VariantVariant specifying the rate at which the balance declines. 若省略它,则假定为 2(双倍余额递减法)。If omitted, 2 (double-declining method) is assumed.

说明Remarks

双倍余额递减法加速计算折旧。The double-declining balance method computes depreciation at an accelerated rate. 折旧额在第一个期间是最高的,随后将逐个期间下降。Depreciation is highest in the first period and decreases in successive periods.

lifeperiod 参数必须用相同的单位表示。The life and period arguments must be expressed in the same units. 例如,如果以月份表示 life,则也必须以月份表示 periodFor example, if life is given in months, period must also be given in months. 所有参数都必须是正数。All arguments must be positive numbers.

DDB 函数使用以下公式计算给定期间的折旧额:The DDB function uses the following formula to calculate depreciation for a given period:

折旧/周期= ((成本 - _残_值) *因子)/生命Depreciation / period = ((cost - salvage) * factor) / life

示例Example

此示例使用DDB函数在给定的初始成本 (InitCost)、资产的使用寿命结束时的残值 (SalvageVal)、资产的总寿命 (年数) (年数 (LifeTime)) 中返回某项资产的折旧值, 并在计算折旧的期间 (以年为单位)Depr()。This example uses the DDB function to return the depreciation of an asset for a specified period given the initial cost (InitCost), the salvage value at the end of the asset's useful life (SalvageVal), the total life of the asset in years (LifeTime), and the period in years for which the depreciation is calculated (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) & "."

另请参阅See also

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.