#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
RJ
 
Posts: n/a
Default calculate month

How can I calculate the number of months (or years) between two dates, such as
06/11/2000 and 09/20/2005?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett
 
Posts: n/a
Default calculate month

Use the datedif if tookpak installed

--
Don Guillett
SalesAid Software

"RJ" wrote in message
...
How can I calculate the number of months (or years) between two dates,
such as
06/11/2000 and 09/20/2005?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
pdberger
 
Posts: n/a
Default calculate month

RJ --
In the last response, don't use 30.4 -- that's days in a month. Use 12 --
months in a year.

My bad.

"RJ" wrote:

How can I calculate the number of months (or years) between two dates, such as
06/11/2000 and 09/20/2005?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
pdberger
 
Posts: n/a
Default calculate month

RJ --
If the start date is in A1 and the end date is in B1, I'd calculate months
like this:
=INT(YEARFRAC(A1,B1)*30.4)

There may be an easier way to calculate years, but I'd do it like this:
=YEAR(B1) - YEAR(A1)

hth

"RJ" wrote:

How can I calculate the number of months (or years) between two dates, such as
06/11/2000 and 09/20/2005?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
RJ
 
Posts: n/a
Default calculate month

Sorry, it's not installed. Any other thoughts on a formula/function I could
use?

"Don Guillett" wrote:

Use the datedif if tookpak installed

--
Don Guillett
SalesAid Software

"RJ" wrote in message
...
How can I calculate the number of months (or years) between two dates,
such as
06/11/2000 and 09/20/2005?






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default calculate month

You don't need the ATP, just use it as

=DATEDIF(start_dat,End_Date,"m")

--

Regards,

Peo Sjoblom


"RJ" wrote in message
...
Sorry, it's not installed. Any other thoughts on a formula/function I

could
use?

"Don Guillett" wrote:

Use the datedif if tookpak installed

--
Don Guillett
SalesAid Software

"RJ" wrote in message
...
How can I calculate the number of months (or years) between two dates,
such as
06/11/2000 and 09/20/2005?






  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
 
Posts: n/a
Default calculate month

On Fri, 6 Jan 2006 07:26:02 -0800, "RJ" wrote:

How can I calculate the number of months (or years) between two dates, such as
06/11/2000 and 09/20/2005?


=DATEDIF(start_date,end_date,"m")

-- 63 with your data.

Of course, you have to be aware that when you are dealing with dates near the
end of the month, and the end_date month does not have as many days, you may
get unexpected answers.

For example:

start_date 29 Jan 2006, 30 Jan 2006 or 31 Jan 2006
end_date: 28 Feb 2006

Result: 0 months

Depending on exactly what you want, this may or may not be adequate.


--ron
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default calculate month

I've been trying to calculate the number of months (including fractions of
months) between two dates. The closest I've come is using YearFrac.

Date1 = 01/01/2006 - Cell A1
Date2 = 11/30/2011 - Cell A2

YearFrac(A1,A2)

Result = 5.914 (Years) - Cell A3

Months = A3*12

Result = 70.97 (Should be 71)

I think YearFrac is the closest formula but it's not always perfect. Any
way to make it work right every time?

Bill Johnson

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default calculate month

Bill Johnson wrote:
I've been trying to calculate the number of months (including fractions of
months) between two dates. The closest I've come is using YearFrac.

Date1 = 01/01/2006 - Cell A1
Date2 = 11/30/2011 - Cell A2

YearFrac(A1,A2)

Result = 5.914 (Years) - Cell A3

Months = A3*12

Result = 70.97 (Should be 71)

I think YearFrac is the closest formula but it's not always perfect. Any
way to make it work right every time?

Bill Johnson



Define "between two dates"...

- Including both Date1 and Date2
- Including only Date1
- Including only Date2
- Including neither
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default calculate month

Glenn wrote:
Bill Johnson wrote:
I've been trying to calculate the number of months (including
fractions of months) between two dates. The closest I've come is
using YearFrac.

Date1 = 01/01/2006 - Cell A1
Date2 = 11/30/2011 - Cell A2

YearFrac(A1,A2)

Result = 5.914 (Years) - Cell A3

Months = A3*12
Result = 70.97 (Should be 71)
I think YearFrac is the closest formula but it's not always perfect.
Any way to make it work right every time?

Bill Johnson



Define "between two dates"...

- Including both Date1 and Date2
- Including only Date1
- Including only Date2
- Including neither


Based upon your desired results above, it looks like you mean the first
(including both dates). Therefore, either of the following should get you
closer to the answer you want:

=YEARFRAC(A1-1,A2)*12

or

=((YEAR(A2)-YEAR(A1)-1)*12)+(12-MONTH(A1))+(MONTH(A2)-1)+((DATE(YEAR(A1),MONTH(A1)+1,1)-A1)/DAY(DATE(YEAR(A1),MONTH(A1)+1,0)))+(DAY(A2)/DAY(DATE(YEAR(A2),MONTH(A2)+1,0)))
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
Calculate the first day of the month for the current month? April S. Excel Discussion (Misc queries) 5 July 27th 05 08:53 PM
Calculate running target by days in the month Robert Excel Worksheet Functions 2 July 4th 05 06:14 AM
How to calculate the day before last two working day of each month Angus Excel Discussion (Misc queries) 1 June 29th 05 12:22 PM
How to calculate total interest on 12 month loan with early payments Fred Smith Excel Worksheet Functions 0 January 6th 05 02:33 AM
calculate month from week number ankman Excel Worksheet Functions 2 November 24th 04 01:27 AM


All times are GMT +1. The time now is 12:06 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"