+ Reply to Thread
Results 1 to 6 of 6

Counting Days within multiple date ranges

Hybrid View

  1. #1
    Registered User
    Join Date
    03-18-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    3

    Talking Counting Days within multiple date ranges

    I am trying to count Camper Nights in an RV park, by electric service dates. For Example, an RV camper reserved a pull thru with arrival date of 8/8/11, next column has departure date as 8/26/11. The electric service date (on electric bill) are 7/22/11-8/23/11 & 8/24/11-9/21/11. So, I need to count how many camper nights fall within each billing cycle for each reservation line. Can you help?
    Excel help2.jpg

    Lastly, there is the issue of accounting for Overflow dates as shown on the spreadsheet as well. This would exclude any dates in billing periods shown in the column headers and count days that fall outside those dates per the reservation. I eagerly await your expertise.

  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: Counting Days within multiple date ranges

    Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook. Make sure the workbook demonstrates your desired results, mock them up manually. Highlight those cells you're trying to automate.

    Use BEFORE/AFTER sheets if that helps make it clearer.
    _________________
    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
    03-18-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Counting Days within multiple date ranges

    Thank you... see uploaded Excel sheet (both pages)

    Example: Reservation 1 (line 4) - count the number of reservation days IF 8/11/11-8/14/11 falls within the billing dates in column D, E, F, G, or H. The answer should only show up in column E as 3 (days).
    Attached Files Attached Files
    Last edited by cweideman; 03-18-2013 at 07:08 PM.

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

    Re: Counting Days within multiple date ranges

    Put this in D4 and copy down and across the table:

    =MEDIAN(D$2,D$3,$C4)-MEDIAN(D$2,D$3,$B4)

    You can go into the File > Options > Advanced > Sheet options and turn off the display of zero values on that sheet if you wish. I usually don't.

    You'll need to re-enter that date in B9, it's not a real date value.

  5. #5
    Registered User
    Join Date
    03-18-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    3

    Cool Re: Counting Days within multiple date ranges

    Jerry,
    Thank you so much for your help. The formula worked perfectly! You have saved me a TON of work!!

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

    Re: Counting Days within multiple date ranges

    I have marked this thread solved for you.
    In the future please select Thread Tools from the menu above and mark the thread as solved. Thanks.

+ 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