totn Excel Functions

MS Excel: How to use the DDB Function (WS, VBA)

This Excel tutorial explains how to use the Excel DDB function with syntax and examples.

Description

The Microsoft Excel DDB function returns the depreciation of an asset for a given time period based on the double-declining balance method.

The DDB function is a built-in function in Excel that is categorized as a Financial Function. It can be used as a worksheet function (WS) and a VBA function (VBA) in Excel. As a worksheet function, the DDB function can be entered as part of a formula in a cell of a worksheet. As a VBA function, you can use this function in macro code that is entered through the Microsoft Visual Basic Editor.

Syntax

The syntax for the DDB function in Microsoft Excel is:

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

Parameters or Arguments

cost
The original cost of the asset.
salvage
The salvage value after the asset has been fully depreciated.
life
The useful life of the asset or the number of periods that you will be depreciating the asset.
period
The period that you wish to calculate the depreciation for. Use the same units as for the life.
factor
Optional. It is the rate at which the balance declines. If this parameter is omitted, it will assume the factor to be 2.

Returns

The DDB function returns a numeric value.

Applies To

  • Excel for Office 365, Excel 2019, Excel 2016, Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000

Type of Function

  • Worksheet function (WS)
  • VBA function (VBA)

Example (as Worksheet Function)

Let's look at an example to how you would use the DDB examples and explore how to use the DDB function as a worksheet function in Microsoft Excel:

This first example returns the depreciation for an asset that costs $10,000, with a salvage value of $5,000. The useful life of the asset is 5 years. The depreciation is being calculated for the first year.

=DDB(10000, 5000, 5, 1)
Result: $4,000.00

This next example returns the depreciation for an asset that costs $10,000, with a salvage value of $5,000. The useful life of the asset is 5 years. The depreciation is being calculated for the second year.

=DDB(10000, 5000, 5, 2)
Result: $1,000.00

This next example returns the depreciation for an asset that costs $10,000, with a salvage value of $5,000. The useful life of the asset is 5 years. The depreciation is being calculated for the third year.

=DDB(10000, 5000, 5, 3)
Result: $0.00

Example (as VBA Function)

The DDB function can also be used in VBA code in Microsoft Excel.

Let's look at some Excel DDB function examples and explore how to use the DDB function in Excel VBA code:

Dim LValue As Double

LValue = DDb(10000, 5000, 5, 2)

In this example, the variable called LValue would now contain the value of 1000.