Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35
Default Number of years/months/days between 2 dates

I am looking for a formula that gives me the number of years, months and days
between two dates.

e.g. 03/02/1998 - 20/07/2005 (dd/mm/yyyy)
Result: 7 years, 5 months, 17 days

e.g. 01/01/2005 - 01/03/2006
Result: 1 year, 2 months, 0 days

Thank you for your time.

Deborah
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 94
Default Number of years/months/days between 2 dates


Deborah wrote:
I am looking for a formula that gives me the number of years, months and days
between two dates.

e.g. 03/02/1998 - 20/07/2005 (dd/mm/yyyy)
Result: 7 years, 5 months, 17 days

e.g. 01/01/2005 - 01/03/2006
Result: 1 year, 2 months, 0 days

Thank you for your time.

Deborah


Hi Deborah,

Maybe you can use something like this:

=DATEDIF(A1,A2,"y") & " years, " & DATEDIF(A1,A2,"ym") & " months, "
&DATEDIF(A1,A2,"md") & " days"

With the two dates in A1 and A2

Regards,
Bondi

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35
Default Number of years/months/days between 2 dates

Thank you very much Bondi

"Bondi" wrote:


Deborah wrote:
I am looking for a formula that gives me the number of years, months and days
between two dates.

e.g. 03/02/1998 - 20/07/2005 (dd/mm/yyyy)
Result: 7 years, 5 months, 17 days

e.g. 01/01/2005 - 01/03/2006
Result: 1 year, 2 months, 0 days

Thank you for your time.

Deborah


Hi Deborah,

Maybe you can use something like this:

=DATEDIF(A1,A2,"y") & " years, " & DATEDIF(A1,A2,"ym") & " months, "
&DATEDIF(A1,A2,"md") & " days"

With the two dates in A1 and A2

Regards,
Bondi


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Number of years/months/days between 2 dates

On 7 Jul 2006 01:32:46 -0700, "Bondi" wrote:


Deborah wrote:
I am looking for a formula that gives me the number of years, months and days
between two dates.

e.g. 03/02/1998 - 20/07/2005 (dd/mm/yyyy)
Result: 7 years, 5 months, 17 days

e.g. 01/01/2005 - 01/03/2006
Result: 1 year, 2 months, 0 days

Thank you for your time.

Deborah


Hi Deborah,

Maybe you can use something like this:

=DATEDIF(A1,A2,"y") & " years, " & DATEDIF(A1,A2,"ym") & " months, "
&DATEDIF(A1,A2,"md") & " days"

With the two dates in A1 and A2

Regards,
Bondi


Because of the way DATEDIF handles months with different days, there are some
potential pitfalls.

For example:

31-Jan-2005 1-Mar-2006 1 years, 1 months, -2 days

--ron
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Number of years/months/days between 2 dates

On Fri, 7 Jul 2006 01:06:01 -0700, Deborah
wrote:

I am looking for a formula that gives me the number of years, months and days
between two dates.

e.g. 03/02/1998 - 20/07/2005 (dd/mm/yyyy)
Result: 7 years, 5 months, 17 days

e.g. 01/01/2005 - 01/03/2006
Result: 1 year, 2 months, 0 days

Thank you for your time.

Deborah


Because of the fact that neither years, nor months, always have the same number
of days, you can get unexpected results unless you define very clearly what you
want.

For example, Bondi's formula will work usually. But:

31-Jan-2005 1-Mar-2006 1 years, 1 months, -2 days


--ron


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
WORK OUT NUMBER OF WEEKS BETWEEN TWO DATES cyp010905 Excel Worksheet Functions 1 March 7th 06 04:17 PM
Calculate Number of Days Between Dates Minus Weekends Melissa Excel Discussion (Misc queries) 3 March 6th 06 07:20 PM
calculate number of days btw dates Nelson Excel Worksheet Functions 2 March 2nd 06 01:02 AM
Return SEARCHED Column Number of Numeric Label and Value Sam via OfficeKB.com Excel Worksheet Functions 23 January 30th 06 06:16 PM
Find number of days between to dates Qaspec Excel Worksheet Functions 1 January 21st 05 12:14 AM


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

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

About Us

"It's about Microsoft Excel"