+ Reply to Thread
Results 1 to 4 of 4

Determine number of months that falls within a given range within two other dates

  1. #1
    Registered User
    Join Date
    07-30-2012
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    2

    Determine number of months that falls within a given range within two other dates

    Hi,

    I was wondering if there is a way to count the number of months that falls within a given range of dates given dates outside those two given dates. I apologize for not explaining clearly, but here is an example:

    The start and end dates can change.
    Start Date 5/18/2013
    End Date 10/31/2015

    I need to determine how many months ranging from 11/1/12 - 10/31/13 FY12, etc fall within the start and end dates.
    FY12 : 11/1/2012 - 10/31/2013. The formula should return 5.
    FY13 : 11/1/2013 - 10/31/2014. The formula should return 12.
    FY14 : 11/1/2014 - 10/31/2015. The formula should return 12.
    FY15 : 11/1/2015 - 10/31/2016. The formula should return 0.

    I was able to create a formula that returns those values, however, if I decide to change the start date and end dates, it doesn't work. i can't come up with a formula that deals with all scenarios. Any suggestions would help! Thanks in advance!

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Determine number of months that falls within a given range within two other dates

    If your start and end dates are in A2 and B2 then list the start and end dates of the financial year in A4 and B4 and use this formula in C4

    =IFERROR(DATEDIF(MAX(A$2,A4),MIN(B$2,B4)+1,"m"),0)
    Audere est facere

  3. #3
    Registered User
    Join Date
    07-30-2012
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Determine number of months that falls within a given range within two other dates

    Thank you!!!

    I tweaked it a little, =IFERROR(ROUND((DATEDIF(MAX($C$14,C25),MIN($C$15,C26)+1,"d"))/365*12,0),0)
    I really appreciate the help. Thanks again!

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Determine number of months that falls within a given range within two other dates

    @ jchau34

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1