+ Reply to Thread
Results 1 to 6 of 6

Calculate days in month after a given date

  1. #1
    Forum Contributor Grimace's Avatar
    Join Date
    05-04-2009
    Location
    Gold Coast, Australia
    MS-Off Ver
    Excel 2013 and Office 365 Plus
    Posts
    380

    Calculate days in month after a given date

    Hi all

    On the attached example i am trying to determine a few things:
    Column C has a launch date of an initiative, and column D shows how many calls per month this initiative is expected to generate.
    What I want to achieve when a launch date is entered is as follows:
    - produce 0 for any months prior to launch date.
    - calculate the number of days left in the month that the launch date is in including actual launch date as day 1 (workdays or weekends does not matter), and calculate the number of calls relative to this (eg if there are 15 days left out of a 28 day month, then 15/28*call volume would be the figure displayed).
    - all months following the launch date will have the full amount of calls displayed, regardless of how many days are in the month (ie February shows the same number as March even though they have 28 and 31 days respectively)

    I have been able to identify days in the month, as well as taking a date and subtracting the launch date, but cant work out how to limit it to that particular month (eg row 5 takes the first of the month and subtracts the launch date to give a total # of days.

    Thanks
    Darren.
    Attached Files Attached Files
    Last edited by Grimace; 12-20-2010 at 12:42 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Calculate days in month after a given date

    If I've understood...

    Please Login or Register  to view this content.
    edit:

    a more common approach might be:

    Please Login or Register  to view this content.
    here however you're calculating the monthly % at all times (in the earlier ex. you calculate only in the month of commencement)
    Last edited by DonkeyOte; 12-16-2010 at 04:32 AM.

  3. #3
    Forum Contributor Grimace's Avatar
    Join Date
    05-04-2009
    Location
    Gold Coast, Australia
    MS-Off Ver
    Excel 2013 and Office 365 Plus
    Posts
    380

    Re: Calculate days in month after a given date

    Thanks Don

    That works perfectly for what I needed.
    I have realised that I am going to need an end date field incorporated as well, and would like to have a shot at the formula myself before coming back for help.

    Are you able to give me a short run down on the day, month and year functions, and how they are used in this context? I THINK I understand the pattern in your formula, but get a little lost on what is actually getting picked up.

  4. #4
    Forum Contributor Grimace's Avatar
    Join Date
    05-04-2009
    Location
    Gold Coast, Australia
    MS-Off Ver
    Excel 2013 and Office 365 Plus
    Posts
    380

    Re: Calculate days in month after a given date

    Hi DonkeyOte,

    Please see attached file. I have attempted to include an end date column, however have missed something. It now appears to do some kind of funky calculation in the month that the end date occurs, and then has a standard figure for any months following.

    I dont quite have the way the date functions work down pat yet, and any guidance would be greatly appreciated.

    Thanks
    Darren.
    Attached Files Attached Files

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Calculate days in month after a given date

    Darren, for the sake of a succinct formula you might look to adapt the 2nd [edit:] approach from my prior post, eg:

    Please Login or Register  to view this content.
    in the above the following occurs:

    i) calculate lesser of (end date +1) and (end of month + 1)

    ii) calculate the greater of (start date) and (start of month)

    iii) deduct ii) from i) with a MAX trap to ensure a value always >= 0

    iv) calculate the number of days within the month (establish day no. of last day in month)

    v) determine the apportionment % based on iii) / iv)

    vi) calculate amount by multiplying Call Volume by v) %
    as outlined, if you have the Analysis ToolPak activated (and/or are using XL2007+) the DATE based functions can be replaced by more succinct ATP alternatives, eg:

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor Grimace's Avatar
    Join Date
    05-04-2009
    Location
    Gold Coast, Australia
    MS-Off Ver
    Excel 2013 and Office 365 Plus
    Posts
    380

    Re: Calculate days in month after a given date

    Works exactly as i needed thank you .... and thanks for the explanation of the steps, it makes it a lot easier for me to understand, and gets me to a point where I would be confident to step through it and create a like formula in the future.

    Once again, I REALLY appreciate your help ... awesome as always

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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