ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Bug in days360 function (https://www.excelbanter.com/excel-worksheet-functions/83788-bug-days360-function.html)

Philippe_L

Bug in days360 function
 
Hi,

If you enter days360(A1,A2) where A1 is April, 18, 2006 and A2 is
March, 31, 2007 you get correctly 343 days.

BUT if you enter it the opposite way, i.e. days360(A2,A1), you get -342
days.

My HP calculator disagrees with this, and gives logicaly 343 and -343.

Any explanation?


Gary''s Student

Bug in days360 function
 
This is not a bug, its a "featu

From Help:

FALSE or omitted (the third parameter)

U.S. (NASD) method. If the starting date is the 31st of a month, it becomes
equal to the 30th of the same month. If the ending date is the 31st of a
month and the starting date is earlier than the 30th of a month, the ending
date becomes equal to the 1st of the next month; otherwise the ending date
becomes equal to the 30th of the same month.

--
Gary''s Student


"Philippe_L" wrote:

Hi,

If you enter days360(A1,A2) where A1 is April, 18, 2006 and A2 is
March, 31, 2007 you get correctly 343 days.

BUT if you enter it the opposite way, i.e. days360(A2,A1), you get -342
days.

My HP calculator disagrees with this, and gives logicaly 343 and -343.

Any explanation?



Philippe_L

Bug in days360 function
 
I see.

That's odd anyway, and I would have expected the default behavior to
give the same number of days in both ways, and only to use this strange
rule when specified.

It' also weird that the HP calculator gives 343 days in both cases,
since when you specify true in the third parameter in Excel you get 342
days in both cases. I am wondering what rule HP is following...

Anyway, thanks very much for your reply.


Gary''s Student

Bug in days360 function
 
You are very welcome.


b.t.w you might want to give a look at DATEDIF()
--
Gary's Student


"Philippe_L" wrote:

I see.

That's odd anyway, and I would have expected the default behavior to
give the same number of days in both ways, and only to use this strange
rule when specified.

It' also weird that the HP calculator gives 343 days in both cases,
since when you specify true in the third parameter in Excel you get 342
days in both cases. I am wondering what rule HP is following...

Anyway, thanks very much for your reply.




All times are GMT +1. The time now is 04:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com