Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default Formula to calculate exact months and days between two dates

In cell A1 and B1 I have dates (see below)
30/05/2006 12/08/2009
In cell A2 I have formula (see below) which produce the result 39
months
(YEAR(B1)-YEAR(A1))*12+MONTH(B1)-MONTH(A1)

I am looking for formula which should tell me exact months and days
between two dates as difference in above dates are 38 months and 12
days but I don’t know how to achive this by formula. Please can any
friend can help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Formula to calculate exact months and days between two dates

K,

=DATEDIF(A1,B1,"m") & " months, " & DATEDIF(A1,B1,"md") & " days"

HTH,
Bernie
MS Excel MVP


"K" wrote in message
...
In cell A1 and B1 I have dates (see below)
30/05/2006 12/08/2009
In cell A2 I have formula (see below) which produce the result 39
months
(YEAR(B1)-YEAR(A1))*12+MONTH(B1)-MONTH(A1)

I am looking for formula which should tell me exact months and days
between two dates as difference in above dates are 38 months and 12
days but I don’t know how to achive this by formula. Please can any
friend can help


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Formula to calculate exact months and days between two dates

On Wed, 12 Aug 2009 08:24:47 -0700 (PDT), K wrote:

In cell A1 and B1 I have dates (see below)
30/05/2006 12/08/2009
In cell A2 I have formula (see below) which produce the result 39
months
(YEAR(B1)-YEAR(A1))*12+MONTH(B1)-MONTH(A1)

I am looking for formula which should tell me exact months and days
between two dates as difference in above dates are 38 months and 12
days but I don’t know how to achive this by formula. Please can any
friend can help


That's not easy to do; in particular because the "exact" number of days in a
month can vary from 28-31.

If you are looking for "exact" intervals, you would be better off using days
and weeks (which do not vary in length).

If not, then you need to very carefully define what you mean by a "month" and
how you are going to count, with regard to dates in the range 28-31.

In your example, however, I would have thought the correct answer to be 38
months and 13 days; not 12.

I would have figured that the 38 "months" would be 30 May 2006 through 30 Jul
2009. That leaves 31 July 2009 + the 12 days in August which would be 13 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
How calculate exact # of months between two dates? Mark Livingstone Excel Worksheet Functions 9 July 22nd 09 01:23 AM
Calculate Number of Months Weeks and Days Between Two Dates [email protected] Excel Worksheet Functions 4 September 22nd 06 01:47 AM
Formula to calculate number of days between Dates themax16 Excel Worksheet Functions 2 October 21st 05 01:38 PM
formula to calculate # of days between dates, excluding holidays abs2299 Excel Discussion (Misc queries) 8 March 3rd 05 02:21 AM
How do I calculate how many days in which months given two dates . Nick Rogers Excel Programming 1 November 3rd 04 03:29 PM


All times are GMT +1. The time now is 01:29 PM.

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"