View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary L Brown
 
Posts: n/a
Default Datedif incorrect month count - February problem??

After some experimentation, I noted that the DateDif function uses the
month-end date of the start month to decide if a month has passed.
In otherwords, if the start date has 31 days, Apr/Jun/Sep/Nov all have
issues if your start date is the 31st.

Only Feb has issues if your start date is the 30th.

Feb does NOT have problems if the year is a leap year and the start date is
the 29th.

No months have issues if your start date is less than or equal to the 28th.

HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was this
Post Helpfull to you?''.


"JMKCT" wrote:


Thought I was losing my mind when I set up some conditional formatting
based on datedif # of months. The number of months between the start
date and the end of January and the end of February (using eomonth
function) were the same. To double check - I input the following
functions manually inserting the date.

=DATEDIF("11/30/2005","02/28/2006","M")
Answer = 2

=DATEDIF("11/30/2005","01/31/2006","M")
Answer = 2

I've used upper and lower case M with no difference. Any thoughts?
I've been using the datedif function for some forecasting and I'm a bit
concerned with this problem.

Thanks, JMK


--
JMKCT
------------------------------------------------------------------------
JMKCT's Profile:
http://www.excelforum.com/member.php...o&userid=29394
View this thread: http://www.excelforum.com/showthread...hreadid=491085