+ Reply to Thread
Results 1 to 8 of 8

Modify a forum formula to work across several months

  1. #1
    Forum Contributor
    Join Date
    04-02-2013
    Location
    West Palm beach, Fl
    MS-Off Ver
    Excel 2010
    Posts
    113

    Modify a forum formula to work across several months

    Hello,

    I recently sought out help with creating a formula to help me find the amount of days for a specific month between two dates. Here is the link: http://www.excelforum.com/excel-form...end-dates.htmlI didn't realize until just today that I would be expected to be able to modify the formula to work for every month going forward. Example, a start date of 11/25/13 and an end date of 3/15/14. I need the days between those two dates for January 2014 (31), February 2014 (28), and March 2014 (15). Does that makes any sense? Attached I have both formulas I was provided. Can anyone Help?
    Attached Files Attached Files

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,461

    Re: Modify a forum formula to work across several months

    Try in C2:
    =IF(AND(C$1>=$A2,C$1<=$B2),DAY(MIN(EOMONTH(C$1,0),$B2)),"")
    Drag down and across
    Quang PT

  3. #3
    Forum Contributor
    Join Date
    04-02-2013
    Location
    West Palm beach, Fl
    MS-Off Ver
    Excel 2010
    Posts
    113

    Re: Modify a forum formula to work across several months

    bebo021999,

    Thank you! That is exactly what I need! Much appreciated!

  4. #4
    Forum Contributor
    Join Date
    04-02-2013
    Location
    West Palm beach, Fl
    MS-Off Ver
    Excel 2010
    Posts
    113

    Re: Modify a forum formula to work across several months

    bebo021999,

    actually, it works great accept for when the start date is in one of the respective months. (i.e start date 1/1/14, end date 3/15/14, jan 2014 = blank (needs to be 31), feb 2014 = 28, mar 2014 = 15). Is there a way to accomodate start dates for the 2014 months? Thank you very much for your time on this!

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,461

    Re: Modify a forum formula to work across several months

    Maybe:
    =IF(AND(EOMONTH(C$1,0)>=$A2,C$1<=$B2),DAY(MIN(EOMONTH(C$1,0),$B2)),"")

  6. #6
    Forum Contributor
    Join Date
    04-02-2013
    Location
    West Palm beach, Fl
    MS-Off Ver
    Excel 2010
    Posts
    113

    Re: Modify a forum formula to work across several months

    bebo02199,

    Sorry for the delay. I really appreciate your time on this. This formulas is closer to what I need, but it does not count the days correctly between dates in the same month now. (i.e. start date: 2/10/14, end date: 2/22/14, should be 12 days, but instead is showing up as 22 days). Is there a way to compensate for that as well? Or am I being too greedy? :-)

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

    Re: Modify a forum formula to work across several months

    Try this formula in C2 copied across and down

    =MAX(0,MIN(EOMONTH(C$1,0),$B2)-MAX(C$1,$A2)+1)

    That will give you zero in months where there is no overlap, custom format as

    0;;;

    to hide zero values, see attached
    Attached Files Attached Files
    Last edited by daddylonglegs; 03-17-2014 at 09:20 AM.
    Audere est facere

  8. #8
    Forum Contributor
    Join Date
    04-02-2013
    Location
    West Palm beach, Fl
    MS-Off Ver
    Excel 2010
    Posts
    113

    Re: Modify a forum formula to work across several months

    daddylonglegs,

    That does it! Thank you for your input! Both you and bebo021999 have been very helpful, and I have learned a lot from this experience!

+ 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. Convert Work Hours, Days or Work Week to Months
    By mycon73 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-25-2014, 09:04 AM
  2. Replies: 8
    Last Post: 02-20-2014, 05:46 PM
  3. [SOLVED] can't get the formula to work - new to forum
    By foreal73 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-12-2012, 05:19 PM
  4. Replies: 0
    Last Post: 04-13-2012, 03:10 AM
  5. [SOLVED] Average - 3 months / 6 months trend line ( array formula? )
    By ccernat in forum Excel General
    Replies: 3
    Last Post: 04-04-2012, 06:24 AM

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