Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default Completed Months between Dates

Hi - I'm after a formula to find the number of completed months between
2 dates. This may at times go through to the next year - for example:

Cell A1 I have "11:00AM 15/06/09"
Cell A2 I have " 3:00PM 25/02/10"
Cell B3 I want " 7 " to be returned.

Cells A1 and A2 are formatted as hh:hh AM/PM dd/mm/yy

Can anyone suggest a formula I can place in cell B3 to return the number
of completed months?

Tks, Ricky



  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 913
Default Completed Months between Dates

On Sun, 25 Jan 2009 17:09:31 +0900, Ricky
wrote:

Hi - I'm after a formula to find the number of completed months between
2 dates. This may at times go through to the next year - for example:

Cell A1 I have "11:00AM 15/06/09"
Cell A2 I have " 3:00PM 25/02/10"
Cell B3 I want " 7 " to be returned.

Cells A1 and A2 are formatted as hh:hh AM/PM dd/mm/yy

Can anyone suggest a formula I can place in cell B3 to return the number
of completed months?

Tks, Ricky


Try this formula in cell B3:

=MAX(ROW(1:1000)*(DATE(YEAR(A1),MONTH(A1)+ROW(1:10 00)+1,1)<=A2))

Note: this is an array formula that should be confirmed with
CTRL+SHIFT+ENTER rather than just ENTER.

The 1000 in two places can be replaced with any number that is bigger
than the biggest expected result.

Hope this helps / Lars-Åke
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default Completed Months between Dates

That's great! Thanks Lars-Åke

Lars-Åke Aspelin wrote:
On Sun, 25 Jan 2009 17:09:31 +0900, Ricky
wrote:

Hi - I'm after a formula to find the number of completed months between
2 dates. This may at times go through to the next year - for example:

Cell A1 I have "11:00AM 15/06/09"
Cell A2 I have " 3:00PM 25/02/10"
Cell B3 I want " 7 " to be returned.

Cells A1 and A2 are formatted as hh:hh AM/PM dd/mm/yy

Can anyone suggest a formula I can place in cell B3 to return the number
of completed months?

Tks, Ricky


Try this formula in cell B3:

=MAX(ROW(1:1000)*(DATE(YEAR(A1),MONTH(A1)+ROW(1:10 00)+1,1)<=A2))

Note: this is an array formula that should be confirmed with
CTRL+SHIFT+ENTER rather than just ENTER.

The 1000 in two places can be replaced with any number that is bigger
than the biggest expected result.

Hope this helps / Lars-Åke

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Completed Months between Dates

=DATEDIF(A1,A2,"m") would give the number of completed months, which would
be 8, not 7.
--
David Biddulph

"Ricky" wrote in message
...
Hi - I'm after a formula to find the number of completed months between 2
dates. This may at times go through to the next year - for example:

Cell A1 I have "11:00AM 15/06/09"
Cell A2 I have " 3:00PM 25/02/10"
Cell B3 I want " 7 " to be returned.

Cells A1 and A2 are formatted as hh:hh AM/PM dd/mm/yy

Can anyone suggest a formula I can place in cell B3 to return the number
of completed months?

Tks, Ricky





  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 913
Default Completed Months between Dates

On Sun, 25 Jan 2009 09:36:23 -0000, "David Biddulph" <groups [at]
biddulph.org.uk wrote:

=DATEDIF(A1,A2,"m") would give the number of completed months, which would
be 8, not 7.



I guess the OP wanted the number of complete, not completeD, months,
i.e. number of complete months excluding the months of start and end
rather than the time difference measured in a month scale.

Lars-Åke


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default Completed Months between Dates

Thanks David - I should have been a little clearer in my original post.
I'm actually after the number of complete months between the two dates,
so 7 does suit my needs. I do see where you're coming from though.

Regards, Ricky

David Biddulph wrote:
=DATEDIF(A1,A2,"m") would give the number of completed months, which would
be 8, not 7.
--
David Biddulph

"Ricky" wrote in message
...
Hi - I'm after a formula to find the number of completed months between 2
dates. This may at times go through to the next year - for example:

Cell A1 I have "11:00AM 15/06/09"
Cell A2 I have " 3:00PM 25/02/10"
Cell B3 I want " 7 " to be returned.

Cells A1 and A2 are formatted as hh:hh AM/PM dd/mm/yy

Can anyone suggest a formula I can place in cell B3 to return the number
of completed months?

Tks, Ricky

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Completed Months between Dates

You are correct David. Seven is correct only if the OP wants the count of
FULL completed months:

July 2009
August 2009
September 2009
October 2009
November 2009
December 2009
January 2010

--
Gary''s Student - gsnu200828


"David Biddulph" wrote:

=DATEDIF(A1,A2,"m") would give the number of completed months, which would
be 8, not 7.
--
David Biddulph

"Ricky" wrote in message
...
Hi - I'm after a formula to find the number of completed months between 2
dates. This may at times go through to the next year - for example:

Cell A1 I have "11:00AM 15/06/09"
Cell A2 I have " 3:00PM 25/02/10"
Cell B3 I want " 7 " to be returned.

Cells A1 and A2 are formatted as hh:hh AM/PM dd/mm/yy

Can anyone suggest a formula I can place in cell B3 to return the number
of completed months?

Tks, Ricky






  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default Completed Months between Dates

Yep, that's what I was afetr - teh FULL completed months only.

Thanks guys for all your help.

Gary''s Student wrote:
You are correct David. Seven is correct only if the OP wants the count of
FULL completed months:

July 2009
August 2009
September 2009
October 2009
November 2009
December 2009
January 2010

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
Number of Completed Months Rick[_3_] Excel Discussion (Misc queries) 3 December 27th 07 12:19 PM
how do I sort dates by months? David Excel Discussion (Misc queries) 2 May 7th 07 02:49 PM
Adding months to dates should account for 28-30-31 day months Graham Excel Worksheet Functions 3 February 1st 06 12:06 PM
months between 2 dates!!! speary Excel Discussion (Misc queries) 1 August 19th 05 03:22 PM
Need More Help on Dates to Months Xandlyn Excel Worksheet Functions 4 March 12th 05 12:50 PM


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