+ Reply to Thread
Results 1 to 4 of 4

Extracting number of months from date range based on specific criterea

  1. #1
    Registered User
    Join Date
    07-24-2013
    Location
    manchester
    MS-Off Ver
    Excel 2010
    Posts
    4

    Extracting number of months from date range based on specific criterea

    hey guys

    new to the forum and not sure it this is going to be in the correct section but, here we go.

    I have a worksheet I'm currently working on to calculate time apportioned rates for corporation tax. I've done 99.9% of the work needed but as it stands I can't figure out how to get the date calculation to do what I need.

    Basically what needs to happen is this.

    The start and end date for the accounting period is entered and based on this I need to extract the number of months for 3 specific periods

    example

    start date = 01/03/2012
    end date = 28/02/2013

    from this I need to be able to extract the number of months that fall under:
    x= 01/04/11-31/03/12
    Y= 01/04/12-31/03/13
    Z= 01/04/13-31/03/14

    Is this at all possible and if so is anyone able to offer any assistance in getting this done?

    Any pointers in the right direction would be greatly appreciated.

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

    Re: Extracting number of months from date range based on specific criterea

    Hello trianglehead, welcome to Excel Forum,

    will your accounting periods always be whole months (1st of month to last of another), if not how do you want to handle partial months?

    For whole months try this:

    list the start date of each x, y, z period in C1, D1 and E1

    list your specific accounting period start date in A2, end date in B2 then use this formula in C2

    =IFERROR(DATEDIF(MAX($A2,C$1),MIN($B2+1,EDATE(C$1,12)),"m"),0)

    format as general and copy across to E2 - you can put more periods in subsequent rows and copy the formula down
    Last edited by daddylonglegs; 07-24-2013 at 09:25 AM.
    Audere est facere

  3. #3
    Registered User
    Join Date
    07-24-2013
    Location
    manchester
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Extracting number of months from date range based on specific criterea

    Thanks for the quick response there! Much appreciated.

    Just testing out the formula with the dates provided in my original post and it's only recognising period Y as having any month falling within the accounting period.

    on paper the months split out as
    x=1
    y=9
    z=2

    the calculation needs to be whole months so, where possible rounding up/down to whole months would be necessary
    Last edited by daddylonglegs; 07-24-2013 at 02:47 PM.

  4. #4
    Registered User
    Join Date
    07-24-2013
    Location
    manchester
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Extracting number of months from date range based on specific criterea

    Big thanks daddylonglegs

    played around with the formula a little bit and finally got it to work the way it was needed. I'd forgotten that the Y and Z periods were different dates and lengths than the ones given.

    Cheers for the help!

+ 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. [SOLVED] Count the number of whole calandar months in a date range
    By robfresh in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 10-19-2012, 05:28 AM
  2. [SOLVED] Sum Specific range of days into Months based upon Category
    By usc1382 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-29-2012, 11:53 PM
  3. [SOLVED] Calculate date based on number of weeks or months after start date
    By wotsup in forum Excel General
    Replies: 3
    Last Post: 08-17-2012, 06:00 AM
  4. [SOLVED] Can i count the number of months in a specific range
    By radicrains in forum Excel General
    Replies: 12
    Last Post: 09-21-2011, 03:06 AM
  5. Replies: 9
    Last Post: 01-22-2009, 06:01 PM

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