+ Reply to Thread
Results 1 to 2 of 2

Calculating how many months are within several time periods

  1. #1
    Registered User
    Join Date
    04-30-2014
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Calculating how many months are within several time periods

    Hello all,

    I'm new to the forum, so I apologize if I make any mistakes here.

    I'm working with Excel 2007. I've got a spreadsheet that I am using to calculate how much time (in months) is within several time periods.

    I have up to ten sets of dates. A beginning date and an end date. I want to total all those date sets then determine how much time total (without double counting overlapping periods) is within a year, how much time is within 3 years, and how much time is within 5 years.

    For example:

    In one date set I have a beginning date of 4/1/2010 and an end date of 3/15/2014. I know that there is roughly 10.50 months within the last year there. In order to reach that conclusion I use this formula:

    =(IF((-(DAYS360(D7,B7)/30))>=12,12,F7))+((DAYS360(TODAY(),D7)/30))

    B7 is where the beginning date is located (4/1/2010). D7 is where the end date is located (3/15/2014). F7 is where the total months are calculated.

    I use 30 day months and 360 day years to calculate all of this info.

    Using this same date set, I also know that there are roughly 34.50 months within the last 3 years using this formula:

    =IF(B7<=(TODAY()-(365*3)),36,F7)+((DAYS360(TODAY(),D7)/30))

    Again, I know that there are roughly 45.97 months within the last 5 years using this formula:

    =IF(B7<=(TODAY()-(365*5)),60,F7)+((DAYS360(TODAY(),D7)/30))

    These formulas all work individually for one date set. However, when I try to calculate all ten date sets that I might have, the overlaps double up the numbers. I end up with like 15 months in the last year, which is obviously impossible.

    I tried calculating them all together individually then just SUMing them up in sections titled "In the last year" etc, but that didn't work because of overlapping dates.

    What I am needing to figure out is:

    1.) A way to streamline these formulas if possible. They seem verbose. I figure there is some function that I don't know about that would help immensely, but I'm not very advanced in excel.

    2.) A way to only count overlapping dates one time so that it does not show too many months within a year, within 3 years, and within 5 years.

    3.) A way to add all the date sets together efficiently, taking into account #2.

    Any help would be greatly appreciated!

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: Calculating how many months are within several time periods

    Attach a sample workbook, not a picture of your workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Calculating Months/Yr including partial months
    By run2win17 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-24-2017, 10:46 AM
  2. Help with Calculating/Graphing Avg Server Process Cycle Time - Excluding Idle Periods
    By kr4z33ch3m15t_78 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-05-2013, 05:55 AM
  3. [SOLVED] Allocate months across periods in which they fall?
    By maladrat in forum Excel General
    Replies: 9
    Last Post: 07-26-2012, 01:21 PM
  4. Replies: 1
    Last Post: 10-10-2005, 06:05 PM
  5. Replies: 1
    Last Post: 10-10-2005, 08:30 AM

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