Calculating time between mulitple dates

P

PJS

Question

Let's take for example a Hire-date of 10/16/06 in cell A2

=DATEDIF(A2,NOW(),"y")&" years "&DATEDIF(A2,NOW(),"ym")&" months "
and I get 2 years and 10 months

but now I have 3 dates... Hire-date, Term-date, Rehire-date
Is there a forumula that would calculate the years and months in between?

For example
Hire-date = 10/23/06
Term-date = 08/02/08
Rehire-date = 04/06/09

I was able to calculate the months using the forumula
=(DATEDIF(B3,C3,"M")+DATEDIF(D3,NOW(),"M")) = 25

but I am having some trouble changing the 25 into 2 years 1 month

Thanks,

PJS
 
J

Jacob Skaria

Try
=INT((DATEDIF(B3,C3,"m")+DATEDIF(D3,TODAY(),"m"))/12) &" Years " &
MOD(DATEDIF(B3,C3,"m")+DATEDIF(D3,TODAY(),"m"),12) &" months"

If this post helps click Yes
 
P

PJS

Thanks Jacob Skaria, the forumla works...
but I neglected to mentioned that C3 and D3 (Term-date and Rehire-date) can
be null.... thus resulting in a NUM error...
 
J

Jacob Skaria

Try the below

=INT((DATEDIF(B3,IF(C3,C3,TODAY()),"m")+IF(D3,DATEDIF(D3,TODAY(),"m"),0))/12) &" Years " &
MOD(DATEDIF(B3,IF(C3,C3,TODAY()),"m")+IF(D3,DATEDIF(D3,TODAY(),"m"),0),12)
&" months"

If this post helps click Yes
 
P

PJS

Thanks Jacob, it is working!

Jacob Skaria said:
Try the below

=INT((DATEDIF(B3,IF(C3,C3,TODAY()),"m")+IF(D3,DATEDIF(D3,TODAY(),"m"),0))/12) &" Years " &
MOD(DATEDIF(B3,IF(C3,C3,TODAY()),"m")+IF(D3,DATEDIF(D3,TODAY(),"m"),0),12)
&" months"

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top