My discovery on adding months and days to a date!
Hi Epinn
Interesting discover u got there, havent thort about that before
If i got ur right - u are questening is Microsoft Excel doing it the right
way?
adding month before days,- hmm who nows - im not sure but the result
sure depending on that. And im sure alot of pepole would do it the 1 way
and som the other.
Therefor we have to question our self every time what result do we want.
sry. my frensh - Denmark u no :-)
"Epinn" skrev:
<< It depends on which month ......
This basic is very much understood.
Which month is in turn dependent on whether one adds months first or one adds days first. This is the essence of my findings.
I am not sure if I am truly understood.
Epinn
"Kevin James" wrote in message ...
Hi Eppinn,
It depends on which month and therefore "What is a month"?
Sometimes its 28 days, 29 days , 30 days and others it is 31.
Depends on the particular month just what effect adding 10 days
will have on the actual day value, as you illustrated.
HTH
--
Kevin James.
Tua'r Goleuni
"Epinn" wrote in message
...
I found the following on a web site.
************************************************** ************************************************** ****
For example, adding 6 months and 10 days to 8/25/97, in A1 with the formula
=DATE(YEAR(A1),MONTH(A1)+6, DAY(A1)+10)
gives 3/7/98.
************************************************** ************************************************** *****
I insert the formula and 8/25/97 in a worksheet and sure enough Excel gives me
3/7/98. I understand that Excel adds the months *first* before it adds the
days. Evaluate formula confirms this.
However, I get a different result when I break up the above process into two
and change the sequence of addition. This is what I have done.
I enter 8/25/97 into A1. Then I enter into B1 this formula
=DATE(YEAR(A1),MONTH(A1),DAY(A1)+10)
Please note that I only add 10 days. The result in B1 is 9/4/1997.
Then in C1, I enter
=DATE(YEAR(B1),MONTH(B1)+6,DAY(B1))
After adding six months, I get 3/4/1998 in C1.
As you will have noted, this result is different from 3/7/98 as stated above.
In both Excel processes, I add six months and 10 days to 8/25/97. But the
results are so different depending on the sequence of addition. (I do know
that if I split the process into two and add months *first* and then days,
I'll get 3/7/1998).
If I am not using Excel, I am inclined to add days before I add months as I
want to go with the smallest unit first. Is it just me? What is the habit of
others? In an office environment, if someone wants to add six months and 10
days, which of the above result is really expected?
Comments welcome.
Epinn
|