+ Reply to Thread
Results 1 to 4 of 4

Excel 2007 : Checking if a time cell falls within a given time range

  1. #1
    Registered User
    Join Date
    05-21-2012
    Location
    Toronto, Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    2

    Post Checking if a time cell falls within a given time range

    Hi all, this is my first post. Hope everyone's doing well

    I'm having a problem that seems really trivial to solve, but I'm unable to figure it out. Here goes:

    I have 2 columns A and P:

    A P

    0:23 00:30 - 02:30
    1:32 02:30 - 04:30
    1:34 04:30 - 06:30
    1:55
    2:09
    2:21
    2:43
    2:53
    4:04
    4:25
    5:08

    I need to figure out how many in column A fall within the ranges of column P. I've tried using IF and that wont work, same with COUNTIF.
    Any help would be appreciated a lot.

    Thanks in advance!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Checking if a time cell falls within a given time range

    if the contents of P1 (?) are "00:30 - 02:30" then you will have a hard time finding out is 1:32 falls within that range. this is because "00:30 - 02:30" is text, and 1:32 is more than likely a value

    i will see what i can come up with for you
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    05-21-2012
    Location
    Toronto, Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Checking if a time cell falls within a given time range

    Ah, I see. Okay, so what if I were to place the range extrema in two different columns ? Like this:

    A B C
    0:23 0:30 2:30
    1:32 2:30 4:30
    1:34 4:30 6:30
    1:55
    2:09
    2:21
    2:43
    2:53
    3:20
    3:37
    4:04
    4:25
    5:08

    Would that help ?

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Checking if a time cell falls within a given time range

    ok, assuming your data is as you posted, in D1, copied down, use this formula...

    =COUNTIFS($A$1:$A$13,">="&B1,$A$1:$A$13,"<"&C1)

+ 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