View Single Post
  #10   Report Post  
JE McGimpsey
 
Posts: n/a
Default

Perhaps, but it gives some inconsistent answers...

A1: 12/30/2004
B1: 4/30/2004 === 0

Add 1 day:

B1: 5/1/2004 === 2

What happened to 1?

Another:

A1: 12/30/2004
A2: 2/28/2005 === 29

but

A2: 3/1/2005 === 2

Now we skip 0 and 1.

Those may be acceptable results for some circumstances, but it probably
isn't for others.

The problem, I think, is intractable. What is *exactly* 12/30/2004 plus
two months? Legitimate cases can be made for any day in the range
2/27/2005 - 3/2/2005, depending on how you define "month".


In article ,
"Arvi Laanemets" wrote:

This was a bad surprise for me - I have used DATEDIF quite often, and as I
now see, without checking it tgroughly before! How about this workaround
(days part only):

=DATEDIF(A1,B1,"MD")+(DAY(A1)DAY(B1))*MAX(0,DAY(E OMONTH(A1,0))-DAY(EOMONTH(B1
,-1)))