Keep dynamic data sorted

nelsok

Board Regular
Joined
Jan 20, 2006
Messages
166
The only thing i can think of to make my dynamic data always be sorted is to use a formula to sort it.

Does anyone have a formula for sorting data in descending order?
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Hi,

Try:

C2: =SUMPRODUCT(--(A2<$A$2:$A$10))+COUNTIF($A$2:A2,A2)
D2: =INDEX($A$2:$A$10,MATCH(ROW()-ROW($D$1),$C$2:$C$10,0))

Both dragged down.
Book1
ABCD
1List1RankSorted list
2q3x
3a6t
4c4q
5x1c
6c5c
7a7a
8259a
9t2a
10a825
Sheet1
 
Upvote 0
this will work but the only issue I have is that there are other cells associated with the values being sorted... for example a1 has a name b1 has revenue and c1 has expenditure and d1 has b1/c1...


I would want to sort by d1 but still have the correct data associated with each cell.

is this possible?
 
Upvote 0
Sure.

Column C is base line. Just use the same formula as in column D, copied to further columns, to refere to the other columns you would like to sort along.
 
Upvote 0
This is working perfectly. However is it possible to get the cells with "" to be at the end of the sort and not the begining?
 
Upvote 0
I see.

="" is concidered "larger" than a number.


In my exhibit above, replace the formula in C2 with

=IF(A2<>"",COUNTIF($A$2:$A$10,">"&A2)+COUNTIF($A$2:A2,A2),COUNTA($A$2:$A$10)+1-COUNTIF($A$2:A2,A2))+IF(ISNUMBER(A2),COUNTA($A$2:$A$10)-COUNT($A$2:$A$10)-COUNTBLANK($A$2:$A$10))
 
Upvote 0
Upvote 0
I don't see why you should need to take it away. If you have only numbers it should work but with a mix of text and numbers and formula blanks, I get an error without the 1.
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,669
Members
448,977
Latest member
moonlight6

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top