An XLSref Investigation: Testing Excel's DB()


An XLSref Investigation: Testing Excel's DB()

Did Excel 2003's DB() function have a bug? Who knows? That's why I investigated this for XLSRef (powered by LeoThreads).



Images are edited screen captures from either Excel 2003 or LeoThreads. Edits made using MS Paint.


Background

In workplace settings, I used whatever the current version of MS Office (and, therefore, Excel) was, and that changed several times. For personal use, I was using various versions of an open source suite of MS Office-compatible applications named LibreOffice, and Calc was its spreadsheet.

Since I needed to explain things using a more familiar menu structure, I had purchased an ancient version of Excel. Price point determined how ancient I would go, and for a while I was using Excel 2000 before I "upgraded" to Excel 2003.

Recently at XLSRef (powered by LeoThreads)

While preparing the XLSref entry at LeoThreads for function DB(), I encountered a series of formulas used to calculate depreciation using the fixed-declining balance method along with the formula for calculating the rate of depreciation.

These financial formulas are straightforward, but because of how they were presented in the Excel 2003 Help page for DB() I wasn't sure if I was typing them properly into XLSref. This is how the equations appeared in Help:


Excel 2003 Help page for DB
Click to view full-size image



Here is how those formulas were translated for XLSref:

Thread 6 of 9
Click to view Thread


Thread 8 of 9
Click to view Thread


Thread 9 of 9
Click to view Thread


The equations looked OK, but how would they translate into actual spreadsheet use? My greatest concerns were with exponentiation and rounding errors.


Behind-the-scenes formulas which make DB() function

Click to view full-size image


So I tested DB() against formulas based on the XLSref entry I made for DB() at LeoThreads.

First Trial

Using the same figures from the Excel 2003 Help page, I set up a small table as shown below:


Table for calculated Rate, Not Rounded
Click to view full-size image


Here is the same table in Markdown:

ValueFactorNamed RangeMonthsDB()FormulasDB()-Formulas% of DB()
1000000CostCost=$A$167$186,083.33185912.96$170.3799.9084%
100000SalvageSalvage=$A$1712$259,639.42259456.00$183.4299.9294%
6Period (years)Life=$A$1812$176,814.44176765.31$49.1399.9722%
,,,,,,,,,12$120,410.64120428.81($18.17)100.0151%
7Months in YiMonthYi=$A$2012$81,999.6482047.19($47.55)100.0580%
5Months in YfMonthYf=$A$2112$55,841.7655898.10($56.34)100.1009%
0.318707931Rate, Not RoundedN/A5$15,845.1015867.89($22.79)100.1438%

Things To Note:

1️⃣Period is for 6 years, but DB() was used 7 times

The initial year is a partial year, covering just 7 months. This year requires the "Initial DB" formula.

The final year is also a partial year, covering just 5 months (12-7). This year requires the "Final DB" formula

Together they make up 1 year of depreciation. The middle 5 years are each full years, so that's 6 total years.

2️⃣Discrepancies between DB() and "DB()-Formulas" are due to Rate

In some years the discrepancy is positive, and in some negative. The discrapancies range from 99.9084% to 100.1438%, for a spread of 0.2354%. For some situations, that may be OK. For a business needing to account for depreciation-- not to mention to keep the taxing authorities at bay-- it is unacceptable.

3️⃣XLSref formulas work-- with one exception

Although the Help page for DB() mentioned this detail, it didn't register with me until some time later:

rate = 1 - ((salvage / cost ) ^ (1/life)), rounded to three decimal places

(Emphasis added)

Using the Rate formula just quoted, it worked as expected and returned 0.318708.

Accounting for the rounding requirement, this is the revised Rate formula used in the new table:

=ROUND( 1-((Salvage/Cost)^(1/Life)) ,3)

(Emphasis added)

Rounded to Precision 3, the rate to be used is 0.319. For this reason, the named range Rate was modified from Rate=$A$22 to Rate=$A$32. All other named ranges kept their assigned references.

Second Trial

Using the figures from the updated table, these are the results of my second trial:


Table for calculated Rate (Precision 3)
Click to view full-size image



Here is the same table in Markdown:

ValueFactorNamed RangeMonthsDB()FormulasDB()-Formulas% of DB()
1000000CostCost=$A$167$186,083.33186083.33$0.00100.0000%
100000SalvageSalvage=$A$1712$259,639.42259639.42$0.00100.0000%
6Period (years)Life=$A$1812$176,814.44176814.44$0.00100.0000%
,,,,,,,,,12$120,410.64120410.64$0.00100.0000%
7Months in YiMonthYi=$A$2012$81,999.6481999.64$0.00100.0000%
5Months in YfMonthYf=$A$2112$55,841.7655841.76$0.00100.0000%
0.318707931Rate, Not RoundedN/A5$15,845.1015845.10$0.00100.0000%

Once Rate was set to Precision 3, the formulas matched DB() and the discrepancies disappeared.

Just My Two Sats

It can be tricky translating equations and formulas into a microblogging format. This is why I wanted to confirm that the equations I included in the XLSref entry for DB() worked as intended.

Initially I found discrepancies, then I discovered one detail I hadn't incorporated: Rate is rounded to 3 decomal places.

After adding that requirement, my spreadsheet formulas matched the DB() as expected.

A large portion of the hundreds of spreadsheet functions are for finance and statistics. Given that these are based on formulas and equations too complex for a microblogging context, I will publish recurring posts featuring my tests and validation of those formulas and equations.


Thank You for Reading.  Keyboard Warriors Wanted.


aboutmc_1.png


aboutmc_2a.png

Links in imageURLs
Hive Business Center/created/hive-123507
Hivelist Classifieds/created/hive-150840
Hive Hustlershttps://www.hivehustlers.com/
#LeoThreadshttps://leofinance.io/threads
Hive Projectshttps://hiveprojects.io
Dust Sweeper@dustsweeper
Dust Bunny@dustbunny


aboutmc_3.png

Links in imageURLs
"...to make up for..."https://leofinance.io/hive-167922/@magnacarta/who-is-magnacarta-and-why-is-he-sending-me-pizza
LeoFinancehttps://leofinance.io/@magnacarta
Proof of Brainhttps://proofofbrain.blog/@magnacarta
♦ D.Buzz-only
♦ D.Buzz:
♦ at-magnacarta.buzz
https://blog.d.buzz/#/@magnacarta.buzz
Festivushttps://festivusweb.com/index.php
H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center