OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

office message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: [OASIS Issue Tracker] Commented: (OFFICE-2630) YEARFRAC ambiguity

    [ http://tools.oasis-open.org/issues/browse/OFFICE-2630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18371#action_18371 ] 

Dennis Hamilton commented on OFFICE-2630:

Considering the number of other financial functions that use YEARFRAC internally (one would hope) to deal with their basis adjustments, we have a definite challenge in front of us.

This is looking more and more like a great Codefest challenge problem.

It appears that OOo 3.0 is computing the result as 1+29/365 with no accounting for the fact that 2008 is a leap year.  Surprise, surprise.  My TI BA-35 calculator matches them to that formula exactly out to 8 decimal places with correct rounding in the 9th.

The Gnumeric and Excel 2007 result is (334+60)/365.5 = 1.077975376 (by calculator), operating on the assumption, apparently, that the spanned-year durations are averaged.  (I have seen that in basis descriptions, I think, though I never explored the consequences very closely.  I think David Wheeler's extensive tests confirmed something like this.)

I wonder if there are discontinuities in the actual/actual basis rule, where adding a day in a new (leap) year causes the YearFrac to be less than the period ending one day earlier (or starting one day later)..

> YEARFRAC ambiguity
> ------------------
>                 Key: OFFICE-2630
>                 URL: http://tools.oasis-open.org/issues/browse/OFFICE-2630
>             Project: OASIS Open Document Format for Office Applications (OpenDocument) TC
>          Issue Type: Bug
>          Components: OpenFormula
>    Affects Versions: ODF 1.2 Part 2 CD 1
>            Reporter: Robert Weir 
> I thought we nailed this one a while ago, but I see the problem still in Part 2, CD 01.
> YEARFRAC is currently defined as "Computes the fraction of the number of years between a StartDate and EndDate.
> Basis is the system for determining how many days are in a month or year."
> OK.  So YEARFRAC is A/B where A= number of days between the two dates, using the counting conventions of the basis.  And B is what? A year certainly.  But how many days?  365?  365.25?  Dependent on whether date 1 or date 2 is in a leap year?  
> I thought David figured this out at one point.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://tools.oasis-open.org/issues/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]