View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Lars-Åke Aspelin[_2_] Lars-Åke Aspelin[_2_] is offline
external usenet poster
 
Posts: 913
Default Advanced sorting

On Thu, 17 Jul 2008 08:00:25 -0700 (PDT), Gerben Dirksen
wrote:

Hi, I'm sure someone has asked this before, but I can't find it.

I'm looking for a function that sorts a set of data that contains
references. Example, I have this data:

Apple $1
Banana $5
Citrus $3

Now I want to automatically create a list in a different place that
contains the same data, but sorted to value, in this case the result
would be:

Banana $5
Citrus $3
Apple $1

The original table should stay as it is and be changable, i.e if I
change the value of an apple to $4, the new table should automatically
be updated to:

Banana $5
Apple $4
Citrus $3

I tried simple referencing and then sorting, but then it will simply
copy the order from the original table.

Thanks for any help!

Gerben



Try this formula on row 1 in any column:

=INDEX(A$1:A$100,MATCH(LARGE($B$1:$B$100,ROW()),$B $1:$B$100,0))

Copy the formula to the next column to the right and then copy down as
far as you have rows with data in your first table.

This formula does only work if there are never more than one fruit
with the same price. If that could happen, some other formula will
have to be used,


Hope this helps / Lars-Åke