+ Reply to Thread
Results 1 to 3 of 3

Count how many times a given date falls between date pairs

  1. #1
    Registered User
    Join Date
    08-03-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Count how many times a given date falls between date pairs

    I'm trying to use countif or similar to show how many times a given date is between 2 dates (inclusive).

    Each row of the spreadsheet contains amongst other info, a Start Date and an End Date. If i've got 2 rows like this:

    StartDate EndDate
    01/01/2009 03/01/2009
    02/01/2009 04/01/2009

    I'd want to lookup 02/01/2009 and have it return 2 (02/01/09 falls between the dates on row 1 and the dates on row 2).

    To give some context, this is an export from a database containing staff holiday dates, and I'd like to be able to see how many people will be on holiday on any given date, given the start and end date of all holiday occurances throughout the year.

    Any help would be much appreciated.
    Last edited by XVar; 08-03-2009 at 07:21 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Count how many times a given date falls between date pairs

    Given use of XL2007 you can use COUNTIFS

    =COUNTIFS(A:A,"<="&DATE(2009,1,2),B:B,">="&DATE(2009,1,2))

    obviously the DATE(2009,2,1) could be replaced by a reference to a cell containing the date of interest...

  3. #3
    Registered User
    Join Date
    08-03-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Count how many times a given date falls between date pairs

    Perfect, cheers!

+ 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