Thread: Rank and Sort
View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Rank and Sort

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Basenji" wrote in message
...
Thank you for your input as it solved the problem.

"T. Valko" wrote:

Using named ranges...

$A$2:$A$9 = Acc (Account)
$B$2:$B$9 = Min (Minutes)

Array entered in D2:

=INDEX(A$2:A$9,MATCH(SMALL(IF(Min0,Min+ROW(Min)/10^10,MAX(Min)+1+ROW(Min)),ROWS(D$2:D2)),IF(Min0, Min+ROW(Min)/10^10,MAX(Min)+1+ROW(Min)),0))

Copied across to E2 then down to D9:E9

--
Biff
Microsoft Excel MVP


"Basenji" wrote in message
...


"T. Valko" wrote:

Try this...

Data in the range Sheet1A2:B9

Array entered** on Sheet2 in cell A2:

=INDEX(Sheet1!A$2:A$9,MATCH(LARGE(Sheet1!$B$2:$B$9-ROW(Sheet1!B$2:B$9)/10^10,ROWS(A$2:A2)),Sheet1!$B$2:$B$9-ROW(Sheet1!B$2:B$9)/10^10,0))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the
SHIFT
key then hit ENTER.

Copy across to B2 then down to A9:B9. Accounts for possible ties.

--
Biff
Microsoft Excel MVP


"Basenji" wrote in message
...
On sheet 1 in column A is the name of the account; same sheet column
B
is
a
percentage.

Account Percentage
Mercy 80.4%
Henry 89.6%
Fred 0.00%
Chris 92.70%
Connie 92.00%
Alex 92.60%
Larry 89.80%
Ollie 0.00%

On a second sheet (a summary sheet) a formula is needed to sort and
rank
the
accounts so that the account with the highest percentage is at the
top
of
the
list, like this,

Chris 92.70%
Alex 92.60%
Connie 92.00%
etc

I have tried a combination of formulas but have been unsuccessful.
Thank you.


Okay, now a variation is needed: same accounts but this time the
column
of numbers (general numbers and not percentages this time) and
accounts
need to be ranked and sorted with the low number at the top and any
accounts that have zero will be at the bottom of the list. Thus it
would
look like this.

Account Minutes
Mercy 42
Henry 45
Fred 53
Chris 59
Connie 65
Alex 0
Larry 0
Ollie 0

In the formula you kindly provided I have changed the LARGE function to
SMALL, which puts the numbers in order with the smallest one at the
top,
which is zero. But the zero value in this case is not good and should
be
at
the bottom. The first number can be anything greater than zero. Would
an
IF
function help solve this?

Thank you.