+ Reply to Thread
Results 1 to 3 of 3

Checking if a date falls between 2 (or more) seperate ranges

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    7

    Checking if a date falls between 2 (or more) seperate ranges

    Hello,

    I'm trying to create a sheet that will let me know if someone has booked leave for the last working day of the week.

    Basically when ever someone books leave in our system, the start and end date of their booked time is logged for each leave request creating multiple rows for the same person. For example, If Joe put in 3 different requests, it would show the following in the data export:

    A B C

    NAME START FINISH
    Joe 14/12/2012 14/12/2012
    Joe 21/12/2012 27/12/2012
    Joe 31/12/2012 04/01/2013

    Say I want to know if Joe will be present on each of the days 14th, 21th and 28th of December (each date check to have it's own cell), How would I do this? I have gotten far enough to do the check if I specify the ranges myself, but I'm having trouble getting the formula to use the ranges where Joe is shown in column A to make it less of a chore.

    I have attached a spreadsheet which I hope better defines my question. I have excel 2010

    Many thanks

    ncalvelo
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Checking if a date falls between 2 (or more) seperate ranges

    One way, In F4 dragged across and down

    =IF(SUMPRODUCT(--($E4=$A$4:$A$8),--(F$3>=$B$4:$B$8),--(F$3<=$C$4:$C$8)),"Absent", "Present")
    Does that work for you?

    Other option
    =IF(COUNTIFS($A$4:$A$8,$E4,$B$4:$B$8,"<="&F$3,$C$4:$C$8,">="&F$3),"Absent", "Present")
    Last edited by ChemistB; 01-03-2013 at 12:53 PM.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    11-05-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Checking if a date falls between 2 (or more) seperate ranges

    Excellent stuff.

    both solutions work like a charm.

    Many thanks

    N

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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