View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Sort using formula

Try this...

Enter this formula in C2:

=SMALL(B$2:B$5,ROWS(C$2:C2))

Enter this array formula** in D2:

=INDEX(A$2:A$5,MATCH(SMALL(B$2:B$5+ROW(B$2:B$5)/10^10,ROWS(C$2:C2)),B$2:B$5+ROW(B$2:B$5)/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.

Select both C2 and D2 then drag copy down as needed.

--
Biff
Microsoft Excel MVP


"Russell Dawson" wrote in message
...
As Ernest Hemingway said, "My aim is to put down on paper what I see and
what
I feel in the best and simplest way"

Regards

Russell Dawson
Excel Student


"StephenT" wrote:

Yes young jedi, however the easiest to code is not always the best
approach

I consider myself advanced in Excel but I cannot crack this nut

If one of the advanced users in this forum can solve this problem in-cell
then I will humbly bow and henceforth proclaim their infinite
intelligence

s

"Russell Dawson" wrote:

I know what you have asked for but surely using a macro that only
involves
the users input of Ctrl-A or whatever must be the simplest way of
achieving
your goal.
--
Russell Dawson
Excel Student


"StephenT" wrote:

Hi

I'd like to sort a column of data using a formula, but I am having
challenges because there is non-unique data

eg. Source data : Names in col A and scores in col B

A B
Name 1 21
Name 2 30
Name 3 21
Name 4 40
etc.

Output : I want to be able to re-order the names using the scores, so
in Col
C I'd have the scores in ascending order, and the corresponding name
in Col D

C D
21 Name 1
21 Name 3
30 Name 2
40 Name 4


I cannot use the sort options (as I am building for beginners who may
not be
able to use it) and would prefer to not use a macro (for the same
reason).
Have tried a few different ways but keep getting stumped by the
multiple
names associated with a single score (limiting the potential for an
index/match)

Any ideas?