Description: =DAYS360(A58,NOW()) Agost 31 not exist Steps to Reproduce: 1.=DAYS360(A58,NOW()) 2.now is Agost 31 3. A58 = 9/01 Expected Results: -1 Reproducible: Always User Profile Reset: No Additional Info: LibreOfficeCalc
Created attachment 174699 [details] Sample Document This document shows DAYS360 returning the same value for both August 30 and August 31.
Version: 7.2.0.4 (x64) / LibreOffice Community Build ID: 9a9c6381e3f7a62afc1329bd359cc48accb6435b CPU threads: 6; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win Locale: en-US (en_US); UI: en-US Calc: threaded
This is correct and not a bug. DAYS360() "Returns the difference between two dates based on the 360 day year", see https://help.libreoffice.org/latest/en-GB/text/scalc/01/func_days360.html and https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part4-formula/OpenDocument-v1.3-os-part4-formula.html#DAYS360 for the algorithms. For the example in the report with US-NASD algorithm we have (2021*360=727560 + 8*30=240 + 31) = 727831 - (2021*360=727560 + 9*30=270 + 1) = 727831 = 0 (In reply to Michael Warner from comment #1) > This document shows DAYS360 returning the same value for both August 30 and > August 31. Yes, though that document tests a different, European, algorithm (3rd argument !=0, note also there's no difference between 1 or 2, it's a logical parameter, either 0 or not 0). Result is different in this case. For 2021-08-31 start date day is changed to 30. Then for both we have (2021*360=727560 + 9*30=270 + 1) = 727831 - (2021*360=727560 + 8*30=240 + 30) = 727830 = 1 Please also don't use text arguments for numeric parameters, result depends on settings (i.e. I get #VALUE! errors for all because I use the strictest setting). In this case use the DATE() function instead. Yes, the help is bad on that.
I see. Thanks for this detailed response, Eike. :-)