View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default HELP: Use the autofilter result on one workbook to filter the

Try this revised set-up which should deliver it ..

Illustrated in this sample (based on your posted sample data):
http://www.savefile.com/files/1046220
Extract fail IDs by paper_passmark n list full history in new sht.xls

Source data as posted assumed in sheet: x, cols A to E

In a new sheet: y,
Select the paper & input the paper's passing mark in K4:K5
(This sets the "filter" criteria for the source data in x)

In A2:
=IF(x!C2="","",IF(AND(x!C2<$K$5,x!E2=$K$4),ROW()," "))
Leave A1 blank

In B2:
=IF(ROWS($1:1)COUNT(A:A),"",INDEX(x!A:A,SMALL(A:A ,ROWS($1:1))))

In C2:
=IF(ISNUMBER(MATCH(x!A2,B:B,0)),ROW(),"")
Leave C1 blank

In D2:
=IF(ROWS($1:1)COUNT($C:$C),"",INDEX(x!A:A,SMALL($ C:$C,ROWS($1:1))))
Copy D2 to H2. Select A2:H2, copy down to cover the max expected extent of
source data in x. Col B will return the list of Fail IDs for the paper/mark
set in K4:K5. Cols D to H will return the required full history of the Fail
IDs.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Kathy Houtami" wrote in message
ps.com...
Hi Max

I have tried your solution, unfortunately not quite suited for my
problem.

What I have is 2 worksheets on the same workbook, both worksheets has
exactly the same data.

It has ID column (number), Name, Grade (but I have also added a
numeric column to convert the grade so I can easily do filter on this,
and once the result is produced this numeric column will be hidden
before it goes to print), papers (which will list any papers has been
taken by each student - like your y worksheet, but rather then listing
the papers across, it is all listed down).

ID Name Marks Grade Paper
1001 Nam1 68 C P1
1002 Nam2 78 B P1
1003 Nam3 42 D P1
1004 Nam4 86 A P1
1005 Nam5 65 C P1
1006 Nam6 66 C P1
1001 Nam1 55 C P2
1002 Nam2 60 C P2
1003 Nam3 58 C P2
1004 Nam4 76 B P2
1005 Nam5 43 D P2
1006 Nam6 67 C P2
1001 Nam1 39 E P3
1002 Nam2 89 A P3
1003 Nam3 44 D P3
1004 Nam4 73 B P3
1005 Nam5 40 D P3
1006 Nam6 52 D+ P3
1001 Nam1 68 C P5
1002 Nam2 78 B P8
1004 Nam4 73 B P9
. . . . .
. . . . .
. . . . .

One the first worksheet I have put AutoFilter on the column headers,
so I can filter by Paper and custom filter on the Marks column to find
all failed students for one paper.

And I would like sheet2 to automatically pick up the ID numbers from
the filtered sheet1, and filter sheet2 list to display only those ID
listed on sheet1 and sort by the Paper.

Cheers
Kathy