+ Reply to Thread
Results 1 to 5 of 5

How many days in a month are within a certain date range?

  1. #1
    Forum Contributor
    Join Date
    05-30-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2013
    Posts
    107

    How many days in a month are within a certain date range?

    I have a month, let's say:
    April 2014

    I have a date range, let's say:
    2014-04-20 - 2015-05-13

    How can I calculate the number of days in that date range that are also in the specified month?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,353

    Re: How many days in a month are within a certain date range?

    Which cells are all those dates in?

    Suggest you post a sample workbook.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: How many days in a month are within a certain date range?

    I take it that you mean the number of days within the range of dates specified.

    If the start date is in A1 and the end date is in B1, in C1 enter:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    In D1 enter:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If there are more than 2 consecutive months involved then this becomes more complicated.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How many days in a month are within a certain date range?

    Please see attached file.

    In C2 format cell as Custom "mmm-yyy"

    =IF(ROWS($C$2:C2)>DATEDIF($A$2,$B$2,"M")+2,"",IF(EOMONTH($A$2,ROWS($A$2:A2)-1)>$B$2,$B$2,EOMONTH($A$2,ROWS($A$2:A2)-1)))

    In D2

    =IF(C2="","",DATEDIF($A$2,$B$2,"d")-DATEDIF(C2,$C$15,"D")-SUM($D$1:D1))

    Format cell as General
    Attached Files Attached Files
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How many days in a month are within a certain date range?

    Thank you for the feedback!

    Please mark thread as "Solved" if your issue has been resolved. (Selecting Thread Tools-> Mark thread as Solved).

+ 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] how many days in each month of date range?
    By mrwm in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-26-2013, 09:24 AM
  2. [SOLVED] how many days in each month of date range?
    By mrwm in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-21-2013, 02:37 PM
  3. [SOLVED] Help creating a date range with beginning and ending days of the month.
    By charlesbb88 in forum Excel General
    Replies: 6
    Last Post: 04-27-2012, 09:28 PM
  4. Days In Each Month In Date Range
    By Branno in forum Excel General
    Replies: 2
    Last Post: 02-26-2012, 11:09 PM
  5. Days for each month in a date range
    By goldy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-11-2007, 06:17 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