+ Reply to Thread
Results 1 to 4 of 4

Count whether a particular date is between two dates

  1. #1
    Registered User
    Join Date
    04-24-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Red face Count whether a particular date is between two dates

    Hi there,

    I am hoping I can get some help with this.

    I am trying to calculate the number of rooms that will be needed on each night of this event I'm running. I need to look at the date range (checkin/checkout) for each guest to see if that particular date falls between in. I would like to repeat this for every day of the event. The guest list will get very long.


    Please help! Attachement below

    test.xlsx

  2. #2
    Registered User
    Join Date
    01-28-2014
    Location
    Brno
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: Count whether a particular date is between two dates

    One way to go:

    F12=SUMPRODUCT(($B$3:$B$5<=F2)*($C$3:$C$5>F2)) and drag to the right.

  3. #3
    Forum Contributor
    Join Date
    08-07-2015
    Location
    AB, Canada
    MS-Off Ver
    Excel 2013 x64
    Posts
    132

    Re: Count whether a particular date is between two dates

    I think the best way to do this is to create a formula inside your grid of dates, have a conditional format to automatically fill those cells with colour, and then simply count the values (or sum them) below.

    The following formula returns a 1 if the guest will be staying that night, and a 0 if they won't.

    Please Login or Register  to view this content.
    See the attached file as an example. Hope that helps!

    test (1).xlsx

  4. #4
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Count whether a particular date is between two dates

    Hi,

    As pepe said, you can get the total number of rooms using SUMPRODUCT, though I would start it on 8 Oct, by putting this in E12:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    You might also want your table to fill in automatically, using Conditional Formatting. Select your whole table (not the date row - so E3:O9 in your test file), click Conditional Formatting, click 'New Rule' then 'Use a formula to determine which cells to format'. Put this in the formula box:
    =AND(E$2>=$B3,E$2<$C3)
    Then choose the format you want (green fill). Now your table will colour the booked dates automatically.
    (I don't know why you had two cells containing '1' with red fills. If you need this to happen as well, use Cond Form again, choose 'Highlight Cells Rules' then 'Equal To...', enter '1' and choose a Red Fill.)

    Hope that helps.

    Regards,
    Aardigspook

    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark Thread as Solved'.
    You don't need to give me rep if I helped, but thanks are appreciated.

+ 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] COUNT if Date is between two dates.
    By SteveHawk in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-03-2014, 09:21 PM
  2. Replies: 8
    Last Post: 02-08-2013, 04:29 AM
  3. Replies: 4
    Last Post: 02-02-2012, 09:24 AM
  4. [SOLVED] Count if date is between two dates and value in another column equ
    By mg_sv_r in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-06-2005, 10:35 AM
  5. [SOLVED] Count rows if date is between two specified dates
    By mg_sv_r in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-15-2005, 09:25 AM
  6. [SOLVED] count date occurances in range of dates...
    By Alex in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  7. [SOLVED] count date occurances in range of dates...
    By Alex in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  8. [SOLVED] count date occurances in range of dates...
    By Alex in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM

Tags for this Thread

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