show in text format the difference between 2 dates

  • Thread starter Thread starter catrrmg
  • Start date Start date
C

catrrmg

Hi all! I've got the following to get done: I have to calculate for our
employees for how long do the work for the company. The format of the result
should look similar to "X years X months X days". Given that their number is
quite big, I'm thinking to write a function and use it wherever I need such
calculations. Does anyone have any ideas how may I get this done? Your help
is much appreciated.
 
Hi catrrmg

Use the following which will return the difference between the twoi dates
where, is this example, B1 is their start date and B3 is the current date.

=DATEDIF(B1,B3,"y") & " years, " & DATEDIF(B1,B3,"ym") & " months, " &
DATEDIF(B1,B3,"md") & " days"

Hope this helps
 
thanks a lot. it is really helpful!

Nigel said:
Hi catrrmg

Use the following which will return the difference between the twoi dates
where, is this example, B1 is their start date and B3 is the current date.

=DATEDIF(B1,B3,"y") & " years, " & DATEDIF(B1,B3,"ym") & " months, " &
DATEDIF(B1,B3,"md") & " days"

Hope this helps
 

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

Back
Top