Filtering based on two different range criteria

  • Thread starter Thread starter Terry
  • Start date Start date
T

Terry

Hey,

I've been set a test exercise on excel after having gone
from novice to supposed "power user" on an e-learning cd,
but I'm not feeling too much power at the minute. Here's
the problem:

I have a column titled "Time" and 400 records that are
all different moments of time that a speed camera took a
picure (just to give you the context). I want to (and it
sounds so simple), filter this column so that only photos
taken inbetween 7:00am and 9:30am OR 5:00pm and 6:30pm
are displayed. The autofilter doesnt allow two criteria
to be set and the advanced filter keeps telling me ">"
and"<" are invalid references.

Any help would be greatly appreciated.........

Terry
 
One way ..

Assume Time is in col A, data in A2 down

Enter the 4 time limits, viz.: 7:00 am, 9:30 am, 5:00 pm and 6:30pm
in say D1:G1

Put in C2:

=IF(OR(AND(A2>=$D$1,A2<=$E$1),AND(A2>=$F$1,A2<=$G$1)),"Y","")

Copy C2 down

Now do an autofilter on col C, choose "Y" from the drop menu in C1
 
Back
Top