Thread: Large / Small
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Large / Small

Here's an easy non-array formulas approach using tiebreakers to set it up for
a full auto-descending/ascending sort

Assume your source data as posted within B1:C10
where B1:B10 contains scores (ie real numbers),
C1:C10 are the names/items

Auto-Top xx (Full descending sort)
In E1: =IF(B1="","",B1-ROW()/10^10)
This is the tiebreaker criteria for descending sort

In F1:
=IF(ROWS($1:1)COUNT($E$1:$E$10),"",INDEX(B$1:B$10 ,MATCH(LARGE($E$1:$E$10,ROWS($1:1)),$E$1:$E$10,0)) )
Copy F1 to G1. Select & copy E1:G1 down to G10. Minimize/hide col E. Cols F
& G will return the required results, ie scores/names in descending order by
scores in col B. Any names with tied scores will appear in the same relative
order as they are within the source. Read-off the top xx in cols F & G as
desired. You need the full descending sort to read-off since there could be
multiple ties (you could have say, a 2 way tie for 1st, a 3 way tie for 2nd,
& a 2 way tie for 3rd. aw!)

Auto-Bottom xx (Full ascending sort)
In I1: =IF(B1="","",B1+ROW()/10^10)
This is the tiebreaker criteria for ascending sort. Exactly the same as the
earlier, except for: + (instead of: -)

In J1:
=IF(ROWS($1:1)COUNT($I$1:$I$10),"",INDEX(B$1:B$10 ,MATCH(SMALL($I$1:$I$10,ROWS($1:1)),$I$1:$I$10,0)) )
Copy J1 to K1. Select & copy I1:K1 down to K10. Minimize/hide col I. Cols J
& K will return the required results, ie scores/names in ascending order by
scores in col B. Any names with tied scores will appear in the same relative
order as they are within the source. Read-off the bottom xx in cols J & K as
desired. Again, you'd need the full ascending sort to read-off since there
could be multiple ties. The formula is v.similar to the earlier, except for
the use of SMALL (instead of LARGE) and the point to the criteria col I.

Success? Celebrate it, hit the YES below
--
Max
Singapore
---
":)" wrote:
This is what I have at the moment

=CONCATENATE(ROUND(LARGE(Region!F:F,C4)*100,2),"%" ," -
",INDEX(Region!B:B,MATCH(LARGE(Region!F:F,C4),Regi on!$F:$F,0)))

":)" wrote:

I have a scenario where I need to rank data according to size, top 3 and
bottom 3.
A B C (Large) D
1 20 Car 1 20 - Car
2 15 Dog 2 15 - Dog
3 5 New 3 15 - Are
4 15 Are
5 10 Err

Column A and B are my data, I use column C as reference in the Large and
Small formula and then concatenate with D as the result. But my problem is
when I have 2 similar result as in this example no.2 and 3. What should I do
so that the 3rd highest is correctly reference?