Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default The Seemingly Impossible

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


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 510
Default The Seemingly Impossible

Hi

I think the easiest way will be an ODBC query. Define your table as named
range
MyTable=MySheet!$A$1:$G$10000
(row 1 must contain headers), and save the workbook.

Now, on empty worksheet, create an ODBC query with SQL-string like this (on
fly)

SELECT TOP 5 MyTable.IncidentNumber, MyTable.Date,
MyDate.IncidentDescription, MyDate.Minutes1, MyDate.Minutes2 FROM MyTable
MyTable WHERE MyTable.IncidentNumber IS NOT NULL AND
MyTable.Function="FINANCE" AND MyTable.Area="CREDIT CONTROL" ORDER BY
MyTable.Minutes1 DESC

In query properties, set it to be refreshed on open (, and maybe after some
time interval too). Set data to be overwritten on refresh, and unused rows
to be cleared. Additionally, you can always refresh the query manually too.



--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )



"Danny Lewis" wrote in message
...
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




  #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

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

Danny,

Dang! Was sure that earlier response would have been one way to make the
"impossible" here possible. Perhaps you tried to contact me telepathically,
but I'm afraid if so, your signals were lost & garbled in cyberspace noise.
Drop a line or two here in reply. This is supposed to be a discussion group,
not a dartboard. Don't just issue a challenge and fade away.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 733
Default The Seemingly Impossible

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


Why? This is easier using 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


So far, so good.

Let's reserve I1:I2 for input of the Function & Area

....

Why? Why not just use the F2 and G2 cells?

Put in H2: =IF(AND(X!F2=$I$1,X!G2=$I$2),X!D2-ROW()/10^10,"")

....

Not necessary to use col H for ancillary calculations.

If the incident numbers in X!A:A are distinct,

A2:
=LOOKUP(2,1/(X!$D$2:$D$101-ROW(X!$D$2:$D$101)/2^20
=LARGE((X!$F$2:$F$101=$F2)*(X!$G$2:$G$101=$G2)
*(X!$D$2:$D$101-ROW(X!$D$2:$D$101)/2^20),ROWS(A$2:A2))),X!A$2:A$101)

B2:
=VLOOKUP($A2,X!$A$2:$E$101,COLUMNS($A2:B2),0)

Fill B2 right into C2:E2. F2 would hold the entry for Function and G2
the entry for Area. Fill A2:E2 down into A3:E3. Enter the formulas

F3:
=F$2

G3:
=G$2

Fill A3:G3 down into A4:G6. None of these are array formulas.

This doesn't handle the possibility that there could be fewer than 5
incidents for a particular function and area. If that's a possibility,
then the col A formu



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 733
Default The Seemingly Impossible

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


Why? This is easier using 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


So far, so good.

Let's reserve I1:I2 for input of the Function & Area

....

Why? Why not just use the F2 and G2 cells?

Put in H2: =IF(AND(X!F2=$I$1,X!G2=$I$2),X!D2-ROW()/10^10,"")

....

Not necessary to use col H for ancillary calculations.

If the incident numbers in X!A:A are distinct,

A2:
=LOOKUP(2,1/(X!$D$2:$D$101-ROW(X!$D$2:$D$101)/2^20
=LARGE((X!$F$2:$F$101=$F2)*(X!$G$2:$G$101=$G2)
*(X!$D$2:$D$101-ROW(X!$D$2:$D$101)/2^20),ROWS(A$2:A2))),X!A$2:A$101)

B2:
=VLOOKUP($A2,X!$A$2:$E$101,COLUMNS($A2:B2),0)

Fill B2 right into C2:E2. F2 would hold the entry for Function and G2
the entry for Area. Fill A2:E2 down into A3:E3. Enter the formulas

F3:
=F$2

Fill F2 right into G3. Fill A3:G3 down into A4:G6. None of these are
array formulas.

This doesn't handle the possibility that there could be fewer than 5
incidents for a particular function and area. If that's a possibility,
then the col A formulas would need to be changed to

A2:
=IF(SUMPRODUCT((X!$F$2:$F$101=$F2)*(X!$G$2:$G$101= $G2))=ROWS(A$2:A2),
LOOKUP(2,1/(X!$D$2:$D$101-ROW(X!$D$2:$D$101)/2^20
=LARGE((X!$F$2:$F$101=$F2)*(X!$G$2:$G$101=$G2)
*(X!$D$2:$D$101-ROW(X!$D$2:$D$101)/2^20),ROWS(A$2:A2))),X!A$2:A$101),"")

And the cols B-E formulas to

B2:
=IF(N($A2),VLOOKUP($A2,X!$A$2:$E$101,COLUMNS($A2:B 2),0),"")

And the cols F-G formulas to

F2:
=IF(N($A2),F$2,"")

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ungroup impossible using Excel 2003 ... fredouil3 Excel Discussion (Misc queries) 1 May 29th 06 01:25 PM
Impossible to apply other kinds of character patrik77 Excel Discussion (Misc queries) 0 March 31st 06 02:46 PM
HELP? nested, complex, vlookup? The impossible! ricdik Excel Worksheet Functions 2 January 19th 06 05:08 AM
Seemingly impossible task fluffy Excel Discussion (Misc queries) 2 September 16th 05 05:52 PM
Impossible Formula! Filmmaker Excel Worksheet Functions 5 November 9th 04 07:59 PM


All times are GMT +1. The time now is 09:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"