Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel: Random Sort By Row? 1

Status
Not open for further replies.

ElijahBaley

IS-IT--Management
May 4, 2001
1,598
GB

Hi

I have a simple worksheet with two columns of data, what I would like to do is randomly sort the data by row, eg:

From this,

Apple - Green
Banana - Yellow
Carrot - Orange

To this

Banana - Yellow
Apple - Green
Carrot - Orange

Thanks for any help
 
In the next column enter =RAND()
copy down to the bottom of the data
Sort by the new column Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Thanks xlbo

but all I get when i enter that sum is random numbers:

0.414099226
0.723753271
0.19219913
0.79898689

FYI the two columns are formatted as text.

EB
 
Yup - you asked for a "random sort"
If you sort on the new column, because the numbers generated are random, you will get a random sort.....is that not what you asked for ?? Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Got It!!

create a random value in third column, then sort that column.

My apologies,

Thanks for your help
 
The RAND() function will generate new random numbers everytime the sheet is recalced so if you wanna do a new random sort, just press F9(calculate) and then sort again Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
If you have automatic calculation set, the sheet is recalculated as part of the sort so you don't actually need to explicitly recalculate. If you look after you have sorted you will see that the numbers are not in order.

Enjoy,
Tony
 
xlbo (Geoff)

Thanks for this older post on random sort. I was able to solve a little spreadsheet for my wife. She wanted a random ordering of 5 specific exercise routines. Neat solution.

Regards,
Harry(xbigblue)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top