Skip to main content

DB

Returns the depreciation of an asset for a specified period using the fixed-declining balance method.

Syntax​

expression.DB(arg1, arg2, arg3, arg4, arg5);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe initial cost of the asset.
arg2RequiredApiRange | ApiName | numberThe salvage value of the asset at the end of its lifetime.
arg3RequiredApiRange | ApiName | numberThe number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).
arg4RequiredApiRange | ApiName | numberThe period for which the depreciation will be calculated. Period must use the same units as the useful life of the asset.
arg5OptionalApiRange | ApiName | numberThe number of months in the first year. If this parameter is omitted, it is assumed to be 12.

Returns​

number

Example​

Calculate how much an asset loses value each period in a spreadsheet.

// What is the depreciation amount for a particular period in a spreadsheet?

// Find the fixed-declining balance depreciation for your assets in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.DB(3500, 500, 5, 1, 10));