GNOME Bugzilla – Bug 698772
argument order in DAYS function doesn't match OpenFormula specification
Last modified: 2013-04-25 11:35:44 UTC
In Gnumeric the DAYS function takes arguments DAYS(start_date, end_date). But in the OpenFormula specifcation the argument order is DAYS(end_date, start_date): http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html#__RefHeading__1018182_715980110 And so DAYS in Gnumeric returns the negative of what it would in OpenFormula.
http://office.microsoft.com/en-us/excel-help/days-function-HA102753275.aspx says... DAYS(end_date, start_date) so we're the odd guy in this mix.
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.
Out of curiosity, how was this bug discovered?
Good question! :) A colleague sent me a spreadsheet in ODS format - I think he generated it using LibreOffice Calc. When I opened it in Gnumeric some values in it were nonsensical, and I tracked down the problem to a difference in how LibreOffice and Gnumeric handled the DAYS function.