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

            Bug ID: 89093
           Summary: Function Yearfrac - base 1 -  leap year not recognized
           Product: LibreOffice
           Version: Inherited From OOo
          Hardware: Other
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Spreadsheet
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 113101
  --> https://bugs.documentfoundation.org/attachment.cgi?id=113101&action=edit
bugfile

Maybe duplicate of bug 69569, but don't close as dup,let Winfried decide.

Steps to reproduce:
 - open attached file


See first line - year 2004, which is a leap year, is in yearfrac calculated as
non-leap year in Calc. Number of days between is 30 in both spreadsheets. Excel
calculates 30/366, Calc calculates 30/365.

openFormula definition here:

http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html#__RefHeading__1018218_715980110

lead to 4.11.7

http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html#Basis

Actual/actual lead to

http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html#Basis-ProcedureE

and this is probably how the code is written?

    should take point-> 8. Otherwise, if A and is-leap-year(year(date1)) then
return 366


4.11.7.7Procedure E

    1.Evaluate A: year(date1) != year(date2)    2004 != 2004  FALSE

    2.Evaluate B: year(date2)!=year(date1)+1   2004 != 2005  TRUE

    3.Evaluate C: month(date1) < month(date2)   10 < 11 TRUE

    4.Evaluate D: month(date1) == month(date2)   10 == 11  FALSE

    5.Evaluate E: day(date1) < day(date2)             10 < 11   TRUE

    6.Evaluate F: (A and B) or (A and C) or (A and D and E)    ( FALSE ) or
(FALSE) or (FALSE)

    7.If F is true then return the average of the number of days in each year
between date1 and date2, inclusive. 
     point F is FALSE

    8.Otherwise, if A and is-leap-year(year(date1)) then return 366  =>  should
be 366  ??

    9.Otherwise, if a February 29 occurs between date1 and date2 then return
366 

    10. Otherwise, if date2 is a February 29, then return 366 

    11. Otherwise return 365

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to