https://bugs.documentfoundation.org/show_bug.cgi?id=171969

--- Comment #5 from [email protected] ---
Thanks for the clarification. If the intention is deliberately to preserve
DATEDIF unchanged for interoperability and backward compatibility, then I agree
that changing its calculation semantics may not be desirable.

However, in that case I think the LibreOffice documentation should explicitly
say so.

Currently the Calc Help presents DATEDIF as an ordinary
OpenDocument/OpenFormula function and describes the "md" interval as:

"Number of whole days when subtracting years and months from the difference of
Start date and End date."

There is currently no warning there that "md" can return negative, zero or
otherwise inaccurate results.

Microsoft's own documentation is much clearer on this point. It explicitly
states that DATEDIF is retained for compatibility with old Lotus 1-2-3
workbooks, and specifically warns that the "MD" argument may produce a negative
number, zero, or an inaccurate result, recommending that users avoid it.

If LibreOffice intentionally reproduces that behaviour for interoperability, I
think Calc Help should document the same limitation.

Something along these lines could be added:

"DATEDIF is provided primarily for interoperability and backward compatibility.
The 'md' interval has known limitations inherited from spreadsheet
compatibility behaviour and may return negative, zero or inaccurate results for
some date combinations. Use alternative date functions when possible."

This would make the behaviour consistent with the stated design decision and
would prevent users from interpreting negative "md" results as a Calc
calculation bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to