+ Reply to Thread
Results 1 to 7 of 7

Determine number of days covered for a certain date range

  1. #1
    Registered User
    Join Date
    08-27-2014
    Location
    Manila
    MS-Off Ver
    2007
    Posts
    9

    Determine number of days covered for a certain date range

    Hi,

    I need to determine the number of days covered on a date range for a certain month.

    Say column B has start date, column C has end date, and the consecutive columns are the different months. =DAY(C2-B3)/30 worked but it didnt cover overlapping months. please see attached for sample. sample1.xlsx

    Thanks for the help.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Determine number of days covered for a certain date range

    Can you update your sample workbook, instead of putting in non-working formulas, please fill out the entire table with the expected results so the end goal is 100% clear.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    08-27-2014
    Location
    Manila
    MS-Off Ver
    2007
    Posts
    9

    Re: Determine number of days covered for a certain date range

    My apologies,

    here is with the desired result.

    thanks.
    Attached Files Attached Files

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

    Re: Determine number of days covered for a certain date range

    If you change the dtaes in the header row so they are real dates (1st of each month) then you can use this formula in C2 copied across and down

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

    I formatted the cells so that zeroe display as blanks
    Attached Files Attached Files
    Last edited by daddylonglegs; 08-27-2014 at 06:19 PM.
    Audere est facere

  5. #5
    Registered User
    Join Date
    08-27-2014
    Location
    Manila
    MS-Off Ver
    2007
    Posts
    9

    Re: Determine number of days covered for a certain date range

    Thanks for the help.

    Just one more concern, i am getting 100%s on rows with no entries. is there any way to have these blank? thanks.
    Capture.JPG

  6. #6
    Registered User
    Join Date
    08-27-2014
    Location
    Manila
    MS-Off Ver
    2007
    Posts
    9

    Re: Determine number of days covered for a certain date range

    here's a sample sheet. i need to have an empty row to add future entries.
    Attached Files Attached Files
    Last edited by jayp_; 08-27-2014 at 08:00 PM.

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

    Re: Determine number of days covered for a certain date range

    Try changing to this version in F5

    =MAX(0,MIN(EOMONTH(F$4,0),N($E5))-MAX(F$4,$D5)+1)/DAY(EOMONTH(F$4,0))

    copied across and down

+ 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. How to determine number of Saturdays in a date range?
    By casper_1981 in forum Excel General
    Replies: 4
    Last Post: 03-09-2010, 02:53 PM
  2. Replies: 5
    Last Post: 02-11-2010, 05:13 PM
  3. count no of due days covered between 2 dates
    By Ganesh A in forum Excel General
    Replies: 4
    Last Post: 12-30-2007, 08:04 PM
  4. Number of Days in a Date Range
    By tesouthworthjr in forum Excel General
    Replies: 6
    Last Post: 07-14-2005, 05:06 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