Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default show in text format the difference between 2 dates

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 98
Default show in text format the difference between 2 dates

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

"catrrmg" wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default show in text format the difference between 2 dates

See:

http://www.cpearson.com/excel/datedif.aspx
--
Gary''s Student - gsnu200767


"catrrmg" wrote:

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.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default show in text format the difference between 2 dates

thanks a lot. it is really helpful!

"Nigel" wrote:

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

"catrrmg" wrote:

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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
dates in excel show up as text numbers in merge with word doc relo Excel Worksheet Functions 1 November 6th 07 04:38 PM
how do i format cells in excel to show difference in payment amt Blue Eyes in South Ga. Excel Discussion (Misc queries) 1 February 19th 07 03:45 PM
what is the formula to show the difference between two dates David Excel Discussion (Misc queries) 1 July 27th 06 12:30 AM
Format text 'dates' to real dates Jacy Excel Worksheet Functions 4 July 24th 06 02:10 AM
How to format cells to show dates as the week-ending date of that dereksmom Excel Worksheet Functions 1 July 12th 06 04:40 PM


All times are GMT +1. The time now is 08:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"