Further test with my formula ......
10/15/2005 yields 0 whereas 10/15/2004 yields 1. I think this is acceptable.
I won't go into leap year here as I started a thread on DATEDIF and leap year yesterday.
Thank you for reading.
Epinn
Do you want to know what function I prefer?
I still like DATEDIF even though I don't need the number of months and the number of days.
=DATEDIF(A1,TODAY(),"y")
I tested this formula on July which has passed, on December which is to happen and even on 10/12/2005. The formula passed all three tests and I got one year for October 12, 2005 (birthdate).
I hope MS won't take DATEDIF away in the future. Last night, I was wondering whether it is faster to use DATEDIF or to just do date2 - date1. I think I should give my brain a rest.
Epinn
Hi David
Just tried it again and it returns 62 up to 10 Oct 1944 and 61
thereafter.
Not consistent with what I was seeing before.
I set up a table of dates from 30/09/44 through 11/11/44 down column A,
then filled through for 12 columns so I have from 30/09/44 to 11/11/56.
Copied the formula across as appropriate and then switch from 1 year to
one lower year seems to occur after 11/10 for years 44 and 45, 12/10 for
year 46 and 47, back to 11/10 years 48 and 49 and continues this pattern
of switching after every pair of years
It must be something to do with leap year and Rounding in Excel's
calculation.
I'm not going to give it any more thought!!!!
I have long since discovered that there is no foolproof method of
consistent calculation of date intervals other than the straight
subtraction of one date from another and returning the number of days.
"Sod" was obviously alive and well when our planetary system was formed
giving rise to a cycle around the Sun that is not an exact number of
days, let alone weeks and with a calendar devised which incorporates
such a disparate set of day ranges, how on earth can anyone expect to
get it right<vbg>
--
Regards
Roger Govier
David Biddulph said:
I see what you mean, but are you sure that it's all dates in October,
and not just yesterday (11th Oct)? Doesn't 9/10/44 or 10/10/44 give
62?
I get the impression that we may just be a day adrift for some years,
and my guess is that it's tied up with leap years, but you're right
that my simple formula isn't 100% reliable. Thanks for pointing it
out.