View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 380
Default My discovery on adding months and days to a date!

Excel will evaluate each part as it encounters it, so the 6 gets added to
the month first, then the days. Because adding 6 to the month takes you into
Feb, the 28 day month, adding 10 days takes you further into March.

To do it your way, try

=DATE(YEAR(DATE(YEAR(A1),MONTH(A1),DAY(A1)+10)),MO NTH(DATE(YEAR(A1),MONTH(A1
),DAY(A1)+10))+6,DAY(DATE(YEAR(A1),MONTH(A1),DAY(A 1)+10)))

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"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