I would like to calcuate the diff in the dates by in term of months
e.g. 30.06.05 less 19.11.04 = 8 months. What function should I
use, could any one help please.
As Dave pointed out, DATEDIF() alone does not give you the result you
want -- unless you misstated your requirement. The following might do
the trick for you:
=datedif(A1, A2, "m") +
or(day(A1)<day(A2), and(day(A1)>day(A2), A1=eomonth(A1,0),
A2=eomonth(A2,0)))
where A1 is the earlier date (e.g. 19.11.04) and A2 is the later date
(e.g. 30.06.05). The logic is: the difference in months, plus one
only if:
1. The earlier day is less than the later day (that is, more than an
exact number of months elapsed), as in your example. Or
2. The earlier day is greater than the later day, but both dates are
the end of the month. For example, the difference between 31.12.2004
and 28.2.2005 would be 2 months.