DDB 函数

更新:2007 年 11 月

返回一个 Double 数据类型值,该值指定一笔资产在特定期间内的折旧,可使用加倍余额递减方法或您指定的其他方法进行计算。

Function DDB( _
   ByVal Cost As Double, _
   ByVal Salvage As Double, _
   ByVal Life As Double, _
   ByVal Period As Double, _
   Optional ByVal Factor As Double = 2.0 _
) As Double

参数

  • Cost
    必选。Double 数据类型,指定资产的初始成本。

  • Salvage
    必选。Double 数据类型,指定在使用期结束时资产的价值。

  • Life
    必选。Double 数据类型,指定资产的可用年限。

  • Period
    必选。Double 数据类型,指定计算资产折旧所用的周期。

  • Factor
    可选。Double 数据类型,指定余额递减的比率。如果省略,采用 2(加倍递减方法)。

异常

异常类型

错误号

条件

ArgumentException

5

Factor <= 0、Salvage < 0、Period <= 0 或 Period > Life.

如果正在升级使用非结构化错误处理方式的 Visual Basic 6.0 应用程序,请参见“错误号”一列。(您可以根据 Number 属性(Err 对象) 比较错误号。) 然而,如果可能,应当考虑用 Visual Basic 的结构化异常处理概述 替换这种错误控制。

备注

加倍余额递减方法用加速比率法计算折旧。在第一段时期,折旧率最高,而在随后的期间内递减。

必须用相同的单位表示 Life 和 Period 参数。例如,如果 Life 以月为单位给定,则 Period 也必须以月为单位给定。所有参数都必须为正数。

DDB 函数使用下列公式计算一定时期内的折旧:

Depreciation / Period = ((Cost – Salvage) * Factor) / Life

示例

本示例使用 DDB 函数返回在指定期间内资产的折旧,假设前提包括:初始成本 (InitCost)、资产使用期结束时的残值 (SalvageVal)、资产的总使用期年限 (LifeTime) 以及计算折旧时所使用的以年为单位的周期 (Depr)。

Dim InitCost, SalvageVal, LifeTime, DepYear As Double
Dim Fmt As String = "###,##0.00"

InitCost = CDbl(InputBox("What's the initial cost of the asset?"))
SalvageVal = CDbl(InputBox("Enter the asset's value at end of its life."))
LifeTime = CDbl(InputBox("What's the asset's useful life in years?"))

' Use the SLN function to calculate the deprecation per year.
Dim SlnDepr As Double = SLN(InitCost, SalvageVal, LifeTime)
Dim msg As String = "The depreciation per year: " & Format(SlnDepr, Fmt)
msg &= vbCrLf & "Year" & vbTab & "Linear" & vbTab & "Doubling" & vbCrLf

' Use the SYD and DDB functions to calculate the deprecation for each year.
For DepYear = 1 To LifeTime
    msg &= DepYear & vbTab & _
        Format(SYD(InitCost, SalvageVal, LifeTime, DepYear), Fmt) & vbTab & _
        Format(DDB(InitCost, SalvageVal, LifeTime, DepYear), Fmt) & vbCrLf
Next
MsgBox(msg)

要求

命名空间:Microsoft.VisualBasic

**模块:**Financial

**程序集:**Visual Basic 运行库(在 Microsoft.VisualBasic.dll 中)

请参见

参考

SLN 函数

SYD 函数

财务摘要

ArgumentException