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

 


Help: OASIS Mailing Lists Help | MarkMail Help

office-formula message

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


Subject: Re: [office-formula] DATEDIF (Section 6.9.2)


Hi Andreas,

On Friday, 2009-02-13 12:46:57 -0700, Andreas J. Guelzow wrote:

> I think the real problem here is that the so called "definition" doesn't
> really define the behaviour:
> 
> =DATEDIF(DATE(1992;2;15); DATE(1993;9;15); "d")
> 
> Are we counting days here in 1992 (a leap year) or in 1993 (not a leap
> year)?

"d" is said to calculate the difference in days. From my understanding,
the real day count should be calculated, so the answer should be equal
to

=DATE(1993;9;15)-DATE(1992;2;15)    => 578

which is what Gnumeric does also for DATEDIF().

Assuming you wanted refer

=DATEDIF(DATE(1992;2;15); DATE(1993;9;15); "yd")

instead, that indeed lacks definition. Gnumeric's result is 212, so
calculates days in 1993 (non-leap year). The rule behind that seems to
be "take (non-)leap year of the second date", as

=DATEDIF(DATE(1991;2;15); DATE(1992;9;15); "yd")

results in 213 instead. Can someone confirm / deny?

  Eike

-- 
Automatic string conversions considered dangerous. They are the GOTO statements
of spreadsheets.  --Robert Weir on the OpenDocument formula subcommittee's list.

PGP signature



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