View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Index, Large and Match??

Perhaps an example to illustrate a simple non-array formulas play to
auto-sort source lines in descending order by a certain key col (eg: scores
col) where there's possibility of ties/multiple ties

Assuming source data is within A2:B10, where col A contains names, col B
contains the corresponding scores. Assume data is unsorted and there could be
ties/multiple ties in the scores in col B

In C2:
=IF(B2="","",B2-ROWS($1:1)/10^10)

In D2:
=IF(ROWS($1:1)COUNT($C$2:$C$10),"",INDEX(A$2:A$10 ,MATCH(LARGE($C$2:$C$10,ROWS($1:1)),$C$2:$C$10,0)) )

Copy D2 to E2. Select C2:E2, copy down to E10. Minimize/hide away col C.
Cols D & E will return the automatic sort in descending order of cols A and
B, by the scores in col B. Tied scores, if any, will be returned in the same
relative order that they appear within the source. Adapt to suit.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:16,000 Files:354 Subscribers:53
xdemechanik
---
"Barb Reinhardt" wrote:
I have two named ranges, Last12Function and Last12Count. What I want to do
pull the data out in order of the highest to lowest values.

I already have determined the "Count" for the top to the bottom, but some of
the counts are duplicates and I'm not sure how to get the match back to the
function.

This is what I have so far, but it only works if there is only one
observation with the given count.

=IF(F9=1,INDEX(Last12Function,MATCH(E9,Last12Count ,0)))

E9 is the value that I get from the "LARGE" function
F9 is the COUNT of the values for the LARGE function.

I don't have anything if the count is 2 or more.

Keep in mind that my data does not start at row 1. It currently starts at
row 9 and that is potentially variable.

I have tried this without any success.,
http://groups.google.com/group/micro...7b34ad797f6404

Any suggestions?

Thanks,
Barb Reinhardt