According to the requirement in  (ODF 1.2), the meaning of the last argument of Calc's VDB function is:
> noSwitch is an optional argument that you include if you do not want VDB to
> switch to straight-line depreciation for the remaining useful life.
> Normally, declining-balance switches to such a straight-line calculation
> when it is greater than the declining-balance calculation.
> If noSwitch is FALSE() or omitted, VDB automatically switches to straight-
> line depreciation when that is greater than declining-balance depreciation.
> If noSwitch is TRUE(), VDB never switches to straight-line depreciation.
That last argument currently has the following description in LO:
I) In the help tip on entering the VDB function in a cell in Calc (with cursor on the last function argument):
> Do not alter. Type = 1 denotes switch to linear depreciation, type = 0 do
> not switch.
II) In LO help ()
> Type = 1 means a switch to linear depreciation. In Type = 0 no switch is
III) In LO code:
- bType variable name in 
- nType variable name in 
The issue is that in the above cases I and II, the description of the argument is the opposite to the requirement. Although the logic seems to be implemented correctly in the code with respect to the values 0 (false) and 1 (true).
For the cases I (help tip) and II (LO help) above:
- Correct the tip and the help content according to the requirement. (I.e., invert the meaning of the content.)
- Change the name of the argument from "Type" to "No_switch", as, e.g., in MS Office (see ). Which is close to name in the requirement.
For the case III above, as alignment:
- Rename the variables to bNoSwitch and nNoSwitch respectively
Correctness of the implemented logic tested on:
Build ID: 1:5.3.7~rc2-0ubuntu0.17.04.1~lo0
CPU Threads: 4; OS Version: Linux 4.10; UI Render: default; VCL: gtk3; Layout Engine: new;
Locale: de-DE (en_US.UTF-8); Calc: group
Version 184.108.40.206 Portable on Win10 64-bit
And compared to MS Excel 2016
Created attachment 137678 [details]
VDB function test spreadsheet (see yellow cells)
The yellow highlighted cells in the attached test file can be used for manual testing of the help tip and the function logic.
Note: SLN is the straight-line depreciation being switched to.
@Eike, Winfried: What is your opinion on this?
I confirm that help(tip) text for the NoSwitch argument is the opposite of what it should be.
A fix will probably be in 2 parts:
-help tip text and internal renaming of variables in the code;
@Johnny_M : given that you already dived into the source code, is it your intention to fix it yourself? If you want, I can point you to the help tip code location for VDB.
If you don't want to fix it, I can do it.
Thank you very much for the feedback, Winfried!
Since especially the help tip part (and LO help) would probably need compilation and testing of the result for visual glitches, etc., and I don't have a build environment, please feel free to take this. I'll be happy no matter who corrects it. :)
Winfried Donkers committed a patch related to this issue.
It has been pushed to "master":
tdf#113768 Fix opposite argument description for Calc function VDB.
It will be available in 6.0.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:
Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":
Related: tdf#113768 VDB change Type parameter opposite to NoSwitch