How do i sort a range and place the results in another range without using Macros?

  • Thread starter Thread starter Douglas
  • Start date Start date
D

Douglas

I have a worksheet that has a table of data.
The table spans cells B2 - Q72

I would like to place the same table of data underneath it but sorted
by one of the colums in Ascending Order, then the same again
underneath that but this time sorted in Descending order.

eg:

|
|Table of Data
|
|
|Table sorted in Ascending Order
|
|
|Table sorted in Descending Order
|



so when data is changed in the top table the sort orders in the tables
underneath are reflected as well.

I would like this to happen automatically when data is entered and not
by manually running a macro to update all the time?

Is this possible?
 
Douglas,

You need to insert formulas in column A that ranks the values. You can use
RANK if you have numeric values, or a formula like this in cell A2, copied
down to A3:A72:

=SUMPRODUCT(($B$2:$B$72<=B2)*1)

to rank based on column B. If you can have ties, you need to add something,
like

=SUMPRODUCT(($B$2:$B$72<=B2)*1) + ROW()/1000

and then do a numeric RANK on that value, in yet another column.

Then, to create your auto-sorting tables, use a VLOOKUP keyed to rank
numbers (from 1 to 72 for the first table, and 72 to 1 for the second table)
in column A. Let's say that the top left cell of your first auto-sorted
table is B80. Use this formula, and copy to B80:Q151:

=VLOOKUP($A80,$A$2:$Q$72,COLUMN(),FALSE)

Then make your second table, and you're done.

If you can't get it to work, post back and I will send you a working
version.

HTH,
Bernie
MS Excel MVP
 
Back
Top