Thread: Filtering data
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
MyVeryOwnSelf[_3_] MyVeryOwnSelf[_3_] is offline
external usenet poster
 
Posts: 56
Default Filtering data

Here is my worksheet:
A B C D E F
1 1 2 3 4 5
2 D H E N K
3 Peter afs 1 x aft
4 David x fer 1 1
5 Gordon 1 1 fer fer fer

After filtering the list should look like this:
Peter 1-D-afs
Peter-4-N-aft
David-2-H-fer
Gordon-3-E-fer
Gordon-4-N-fer
Gordon-5-K-fer

The only cells that should not appear on the list are cells with
the values "x" or "1" or blank cells.



Unfortunately, the data is in a format that's inconvenient for Excel's built-in filtering.

One approach is to make an intermediate result that's more convenient. Here's one way.

My example has:
dates in B1:F1
categories in B2:F2
names in A3:A5
user input in B3:F5
intermediate result in J1:M15

In J1 put
=INDEX(A:A,INT((ROW()-1)/5)+3)

In K1 put
=INDEX($B$1:$F$1,1,MOD(ROW()-1,5)+1)

In L1 put
=INDEX($B$2:$F$2,1,MOD(ROW()-1,5)+1)

In M1, put
=IF(INDEX(A:F,INT((ROW()-1)/5)+3,MOD(ROW()-1,5)+2)="","",
INDEX(A:F,INT((ROW()-1)/5)+3,MOD(ROW()-1,5)+2))

In N1 put
=J1&"-"&K1&"-"&L1&"-"&M1
This is the result column.

Select J1:N1 and copy down to row 15.

Finally, filter on column M to exclude "x" or "1" or blank cells.

Hopefully, some variation of the above meets the need.