+ Reply to Thread
Results 1 to 3 of 3

Days In Each Month In Date Range

  1. #1
    Registered User
    Join Date
    07-07-2008
    Location
    Australia
    Posts
    44

    Days In Each Month In Date Range

    Hi,

    I have a start date (purple) in one cell& end date (blue) in another, off to the right there is a column with a EOM date heading (orange). In the cells highlighted in green for each row I need a formula that counts the days between the start date & end date for for that speceific row.

    I have attached a sample spreadsheet & populated the numbers that would expect to see in row 2. For example there is 30 days (H2) between that start (E2) & end date (F2) that fall between EOM (G$1) & EOM (H$1).

    Your assistance would be greatly appreciated.

    Thanks

    Branno
    Attached Files Attached Files
    Last edited by Branno; 02-27-2012 at 09:58 PM.

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Days In Each Month In Date Range

    first i would like to say thank you for the workbook and very clear question

    second, try this:

    =IF(AND($E2<=G$1,$F2>EOMONTH(G$1,-1)),IF($F2>G$1,G$1,$F2)-IF($E2<=EOMONTH(G$1,-1),EOMONTH(G$1,-1)+1,$E2)+1,0)
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Days In Each Month In Date Range

    Not really understanding how you arrive at the values you do. For instance, in Col K, how do you get 3? and in Col H, how do you get 30?

    Maybe if you could explain those 2 examples here such that...datexxx and dateyyy used because of ???
    so therefore datexxx +/- dateyyy = 30
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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