DDB Function


DDB Function

Class

Microsoft.VisualBasic.Financial

Syntax

     DDB(cost, salvage, life, period[, factor]) 


cost (required; Double)

The initial cost of the asset.


salvage (required; Double)

The value of the asset at the end of life.


life (required; Double)

Length of life of the asset.


period (required; Double)

Period for which the depreciation is to be calculated.


factor (optional; Double)

The rate at which the asset balance declines. If omitted, 2.0 is used by default (double-declining method).

Description

The DDB function returns a Double representing the depreciation of an asset for a specific time period. This is done using the double-declining balance method or another method that you specify using the factor argument.

The double-declining balance method calculates depreciation at a differential rate, which varies inversely with the age of the asset. Depreciation is highest at the beginning of an asset's life and declines over time.

Usage at a Glance

  • The life and period arguments must be specified in the same time units. For instance, both must be expressed in units of months, or both must be years.

  • All arguments must be positive numbers.

  • The double-declining balance depreciation method calculates depreciation at a higher rate in the initial period and a decreasing rate in subsequent periods.

  • The DDB function uses the following formula to calculate depreciation for a given period:

         depreciation / period = ((cost - salvage) * factor) / life 

Example

     Dim initialCost As Double = 2000     Dim salvageValue As Double = 50     Dim usefulLife As Double = 12     Dim totalDepreciation As Double = 0     Dim periodScan As Double     Dim thisPeriodDepr As Double     For periodScan = 1 To 12        thisPeriodDepr = DDB(initialCost, salvageValue, _           usefulLife, periodScan)        totalDepreciation += thisPeriodDepr        Console.WriteLine("Month " & periodScan & ": " & _           thisPeriodDepr)     Next periodScan     Console.WriteLine("Total: " & totalDepreciation) 




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net