View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default The Seemingly Impossible

Here's one play using non-array formulas ..

Assume source table in sheet: X
cols A to G, headers in A1:G1, data from row2 down
col F = Function, col G = Area, col D = Minutes 1

In a new sheet,

Paste the same headers in A1:G1
Let's reserve I1:I2 for input of the Function & Area
Input in I1:I2, eg: Finance, Credit Control

Put in H2: =IF(AND(X!F2=$I$1,X!G2=$I$2),X!D2-ROW()/10^10,"")
Copy H2 down to say, H2000,
to cover the max expected extent of data within the source table in X
(Leave H1 empty)

Then place in A2:
=IF(ROW(A1)COUNT($H:$H),"",INDEX(X!A:A,MATCH(LARG E($H:$H,ROW(A1)),$H:$H,0)))

Copy A2 to G2, fill down as far as required to extract the top N
Eg: If top 5, fill down say 10 rows? to G11
to cater for the possibility of any ties in the "Minutes 1"
Tied lines if any, will appear in the same relative order that they appear
in X
(Col H's criteria caters for ties in "Minutes 1", with an arb tiebreaker for
a descending sort)

Format col B as date to taste
Cols A to G will return the required results
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Danny Lewis" wrote:
Hello all

I posted yesterday, when Leo was very helpful but I'd like to try and post
it again and see if there are any geniuses out there...

I have a table, with the following columns:

Incident Number, Date, Incident Description, Minutes 1, Minutes 2, Function,
Area (and a few other irrelevant columns).

This table has a few thousand records in it, with each column varying data.
There are about 6 different functions, and 30 different areas.

Say for example one function was FINANCE, and the area was CREDIT CONTROL,
is there a way I could produce the same table on another spreadsheet for the
top 5 incidents for these two variables, descending by Minutes 1?

e.g. on another worksheet

Incident Number, Date, Incident Description, Minutes 1, Minutes 2, Function,
Area
1 01/01/01 ikgjnsgosgn 78 120 Finance Credit Control
2 23/09/00 jsdgofnyof 65 103 Finance Credit Control

and so on????

Thanks

Danny