special filter or query

  • Thread starter Thread starter tiktin
  • Start date Start date
T

tiktin

I need a filter which will show all rows n and n+1, if and only if, in row n,
A=1 and B=1, and in row n+1, A=0, B=2 and C=4; or, in row n, A=0, B=1 and
C=4, and in row n+1, A=1 and B=2. In other words, whether or not a row is to
be displayed depends not only on what is in the row but also on what is in
the preceding row or the following row. Can you tell me how to do this?
Thanks.
 
For my suggestion to work, your first row of data can NOT start in row 1.
However, row 1 CAN contain your column headers.

Assuming row 1 DOES contain column headers and row 2 is your 1st row of data:

In the first available column to the right of your data, in row 1 add the
column header "Test Column".

In row 2, immediately below the cell containing "Test Column", enter the
following formula:

=IF(OR(OR(AND(A2=1,B2=1,A3=0,B3=2,C3=4),AND(A2=0,B2=2,C2=4,A1=1,B1=1)),OR(AND(A2=0,B2=1,C2=4,A3=1,B3=2),AND(A2=1,B2=2,A1=0,B1=1,C1=4))),"Condition
Met","Condition Not Met")

Copy the formula down to your last row of data.

Now you should be able to apply a filter on your Test Column for all rows
that contain "Condition Met".

Good Luck


Ie, if your data DOES start in row 1, insert a row so row 1 is blank.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top