[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [office-formula] DATEDIF (Section 6.9.2)
On Wed, 2009-02-25 at 14:53 +0100, Eike Rathke wrote: > 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)? Hmm, yeah I meant "yd". (For some reason my mail messages frequently don't contain what I mean. I hope computers will improve some day!) > > "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 That's not the number of days between those two days. It is the difference between the date serial numbers. There is no day between DATE(1993;9;15) and DATE(1993;9;16), but the difference is 1. (I think we should use the difference, and not say "between".) > > which is what Gnumeric does also for DATEDIF(). > > Assuming you wanted refer > > =DATEDIF(DATE(1992;2;15); DATE(1993;9;15); "yd") yes that's what I meant. > > 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? again even if we use the second (or perhaps later year) we should not talk about "between". Andreas -- Andreas J. Guelzow, PhD, FTICA Coordinator, Mathematical & Computing Sciences Concordia University College of Alberta
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]