0
votes

I need to rewrite a vdb() function in Python, I can't find the actual math formula on the internet. Here is the description for the function.

VDB function

This article describes the formula syntax and usage of the VDB function in Microsoft Excel.

Description Returns the depreciation of an asset for any period you specify, including partial periods, using the double-declining balance method or some other method you specify. VDB stands for variable declining balance.

Syntax

VDB(cost, salvage, life, start_period, end_period, [factor], [no_switch])

The VDB function syntax has the following arguments:

Cost Required. The initial cost of the asset.

Salvage Required. The value at the end of the depreciation (sometimes called the salvage value of the asset). This value can be 0.

Life Required. The number of periods over which the asset is depreciated (sometimes called the useful life of the asset).

Start_period Required. The starting period for which you want to calculate the depreciation. Start_period must use the same units as life.

End_period Required. The ending period for which you want to calculate the depreciation. End_period must use the same units as life.

Factor Optional. The rate at which the balance declines. If factor is omitted, it is assumed to be 2 (the double-declining balance method). Change factor if you do not want to use the double-declining balance method. For a description of the double-declining balance method, see DDB.

No_switch Optional. A logical value specifying whether to switch to straight-line depreciation when depreciation is greater than the declining balance calculation. If no_switch is TRUE, Microsoft Excel does not switch to straight-line depreciation even when the depreciation is greater than the declining balance calculation. If no_switch is FALSE or omitted, Excel switches to straight-line depreciation when depreciation is greater than the declining balance calculation.

2

2 Answers

1
votes

The Variable Declining Balance (vdb) method is a combined method of the Declining Balance Depreciation method and the Straight Line Depreciation method, provided no_switch is FALSE or omitted. Otherwise, the standard depreciation method is used even when depreciation is greater than the declining balance calculation. The following assumes no_switch is FALSE or omitted.

The depreciation calculation starts with the declining method. At the period in the life of the asset where the depreciation calculated by the straight line method on the remaining depreciable amount will be greater than the amount calculated by the declining method, you switch to the straight line method for the remainder of the life of the asset.

The formulas are:

Declining Balance:

  1. Straight-Line Depreciation Percent = 100% / Useful Life
  2. Depreciation Rate = Depreciation Factor x Straight-Line Depreciation Percent
  3. Depreciation for a Period = Depreciation Rate x Book Value at Beginning of the Period

Switching to Straight Line Method:

  1. Depreciation in Any Remaining Period = ((Cost - Accumulated Depreciation) / Remaining Life)

Source & online calculator here, where you can find links to information about the Declining Balance Depreciation method and the Straight Line Depreciation method as well.

0
votes

The VDB function is discussed here: http://www.excelfunctions.net/Excel-Vdb-Function.html

It's default is the Double Declining-Balance Method which can be found here: https://en.wikipedia.org/wiki/Depreciation#Doubling_Declining_balance_method