Need help w/program to randomly sort row data

P

please respondhere

I've got an Excel worksheet with several columns of data. I want to randomly
shuffle all of the row data and then overwrite column A with sequential
numbers down the column, 1...X, where X is the last row. Any ideas?

Example:


1 B C D
2 G K L
3 D K C

might become

2 G K L
1 B C D
3 D K C

and then with column A renumbered, look like:

1 G K L
2 B C D
3 D K C


I don't know much about Excel at all. How can I develop such a thing.
Furthermore, can this also be done via a command line?

Thanks.
 
J

Jim May

With your first block of data on rows 1-3 (without a header)
replace the values 1 2 3 (A1,A2 and A3) with =Row() in A1 and copy down
When you sort sort on Column B -- then Column A will automatically change to
1,2 3 (ascending order).
HTH
 
P

please respondhere

Thanks for the feedback. I agree with your response about column A. I do need
to preserve row data, however: (B C D; G K L; D K C) so I can't sort by column
for column B, C, & D. The order of the row data which I have listed using 3
capital letters must be preserved on a given row but the actual row number (
say 1 through X) is to be random. The data in column A must also be listed
sequentially, so I can't have A1 = 5, for example. It must always be 1, A2 =
2, and so on.
 
J

Jim May

Before doing a sort (in excel) as long as you have our active cell
"somewhere" within your given "data-table", that is within a block of data
(the top left corner and the bottom right corner) Excel automatically
"Knows" you have a listing and will automatically assign the area as the
area to be "grabbed" and included in the sort. ALL columns (Highlighted)
will be included in the sort and Everything on a given row will stay
"intact", that is not be rearranged << the basic premise of sorting; so with
your cursor within your data (somewhere) click on the menu Data, Sort, Click
say 1) column b
Everything should be fine. << and your column 1 should rearrange itself to
1,2,3 since it is reading the imbedded row-header number.
HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top