in A1 previous date
in A2 todays date
in A3 i have formula.... =DATEDIF(A1,A2,"d")
Not working, how do I get it to show the length of time between the 2
dates. Years and months[.] I have cells formulated to dates
Define "not working". Provide example dates and show what that
DATEDIF returns. I presume it returns a __correct__ number of days;
the only thing "not working" about it is: you want years and months.
Right?
But in what form do you want the result? In seperate columns? In
text?
For example, ostensibly:
=DATEDIF(A1,A2,"y") & " years " & DATEDIF(A1,A1,"ym") & " months"
However, note that if A1 is 2/29/1980 and A2 is 2/28/2010, that
returns "29 years 1 month". Most people would want "30 years 0
months". Note that EDATE(A1,30*12) is 2/28/2010.
This is a special was "previous date" is on Feb 29 of a leap year, and
"today's date" is on Feb 28 of a non-leap year.
The following can be used to make the appropriate adjustment:
=IF(EDATE(A1,12*DATEDIF(A1,B1,"y")+12)=B1,
DATEDIF(A1,B1,"y")+1 & " years 0 months",
DATEDIF(A1,B1,"y") & " years " & DATEDIF(A1,B1,"ym") & " months")
PS: For broader participation, you might want to post future
inquiries using the MS Answers Forums at
http://social.answers.microsoft.com/Forums/en-US/category/officeexcel.
It's not that I like that forum. It's just that MS has ceased to
support the Usenet newsgroups. Hence, participation here is limited
to the sites that share a common newsgroup mirror, which is no longer
centralized at MS.