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

# office-formula message

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

Subject: Re: [office-formula] DAYS360

• From: Eike Rathke <eike.rathke@oracle.com>
• To: office-formula@lists.oasis-open.org
• Date: Mon, 8 Nov 2010 13:23:01 +0100

```Hi Andreas,

On Friday, 2010-11-05 14:59:56 -0600, Andreas J. Guelzow wrote:

> > The Excel definition is here:
> >
> > http://office.microsoft.com/en-us/excel-help/days360-HP005209047.aspx
> >
> > It looks like the dates are not swapped.  It can return a negative number.
> >
> > Since it doesn't involve year-length calculations, like YEARFRAC() does,
> > we should not need to worry about leap year complexities.  But I cannot
> > guarantee that there are no "quirks" like we saw in YEARFRAC().
>
> in Excel 2007:
> =DAYS360(DATE(2000,2,28),DATE(2000,3,31),0) is 33 but
> =DAYS360(DATE(2000,2,29),DATE(2000,3,31),0) is 30 and
> =DAYS360(DATE(1999,2,28),DATE(1999,3,31),0) is 30
>
> so clearly there are leap year considerations here.

The leap-year consideration is

| 3. Otherwise, if StartDate's day-of-month is the last day of February,
|    it is changed to 30.
| 4. If EndDate's day-of-month is 31 and StartDate's day-of-month is 30
|    (after having applied a change for #2 or #3, if necessary), EndDate's
|    day-of-month is changed to 30.

so for 2000-2-28/2000-3-31 we get 2000-2-28/2000-3-31 and for
2000-2-29/2000-3-31 we get 2000-2-30/2000-3-30.

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]