ODF specification: 6.12.13 DB Summary: Compute the depreciation allowance of an asset. Syntax: DB( Number cost ; Number salvage ; Integer lifeTime ; Number period [ ; Number month = 12 ] ) Returns: Currency Constraints: cost > 0, salvage >= 0, lifetime >0; period > 0; 0 < month < 13 =DB(25000;1000;0;1;6) =DB(25000;1000;36;0;6) =DB(25000;1000;36;-1;6) period parameter specified as "period > 0". Lifetime as "lifetime> 0". These formulas should throws error. Checked in excel and excel return error.
Actually, Calc uses some extra constraints as well (apart from the 2 missing constraints): salvage <= cost lifeTime <= 1200 period <= (lifeTime+1) The first makes sense, and IMHO should be added to ODFF (as DDB does have the constraint salvage <= cost). The others may be there because of the used calculation and/or to ensure fast calculations, I don't know.
Winfried Donkers committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=716f4ef1625cece6fe8326213df24c52d56c9432 tdf#100562 Add constraints for function DB It will be available in 5.3.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Thanks Winfried Verified Version: 5.3.0.0.alpha0+ Build ID: 0325b22a2a2b537a71f53b7c5d3e6c13fef68911 CPU Threads: 4; OS Version: Linux 4.4; UI Render: default; TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-06-24_23:36:22