+ Reply to Thread
Results 1 to 6 of 6

Calculate days in month after a given date

Hybrid View

  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

    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

  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

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

    G6:
    =IF($B6="","",$E6*MAX(0,MIN($D6+1,DATE(YEAR(G$2),MONTH(G$2)+1,1))-MAX($C6,G$2))/DAY(DATE(YEAR(G$2),MONTH(G$2)+1,0)))
    applied to matrix
    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:

    =IF($B6="","",$E6*MAX(0,MIN($D6+1,EDATE(G$2,1))-MAX($C6,G$2))/DAY(EOMONTH(G$2,0)))

+ 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