https://help.libreoffice.org/Calc/Add-in_Functions#MONTHS Type calculates the type of difference. Possible values include 0 (interval) and 1 (in calendar months). =MONTHS("2010-04-03"; "2011-06-17"; 111) return 14. Should return error.
Hi @raal, I think many function have this kind of parameters working in this way, a true/false state, so any value different than zero is true. The same happens with IF() function I guess so it's quicker to know the parameter state. I don't think it is a bug.
> I think many function have this kind of parameters working in this way, a > true/false state, so any value different than zero is true. This is not the case for MONTHS(), YEARS() or WEEKS(). Any value other than 1 is evaluated as 0, which at least might be unexpected..
Eike Rathke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=14e31d6cf4c4ba8a28b932c77994bc905686dba5 Resolves: tdf#100440 check mode to be 0 or 1 for MONTHS(), YEARS() and WEEKS() 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.
Note: needed to adapt the WEEKS and YEARS test documents to cope with the change.