ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   alphanumeric sorting (https://www.excelbanter.com/excel-discussion-misc-queries/23386-alphanumeric-sorting.html)

dancefle

alphanumeric sorting
 
How do I change a column containing c1 c10 c11 c2 c21 c3 to sort as c1 c2 c3
c10 c11 c21?

L. Howard Kittle

One way, in a helper column next to your data enter and pull down.

=RIGHT(A1,LEN(A1)-1)*1

Select both columns and sort by the helper column. Delete helper column.

HTH
Regards,
Howard

"dancefle" wrote in message
...
How do I change a column containing c1 c10 c11 c2 c21 c3 to sort as c1 c2
c3
c10 c11 c21?




Ragdyer

One way is to use TTC (Text To Columns).

Select the data in the column, then <Data <TTC,
Click "Fixed Width", then <Next,
Click in the window, and drag the break line to separate the "C" from the
numbers, then <Next.

The column containing the "C" should be selected (black), so click on "Do
Not Import (skip)".

Then click in the "Destination" window, and enter the address of the column
next to your original.
What this does is preserve your data in it's original location, without
changing anything, and moves *only* the numbers to the next column, skipping
(leaving behind) the letters.
Now, click <Finish.

You should now have your original column of data, and an adjoining column of
numbers, where you now select *both* columns, and sort on the number column
to get your text column of data sorted numerically.

You can then delete the "helper' column of numbers.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"dancefle" wrote in message
...
How do I change a column containing c1 c10 c11 c2 c21 c3 to sort as c1 c2

c3
c10 c11 c21?



David McRitchie

If you actual data is a bit more complicated you might want to take a
look at
Sorting product code with alpha prefix and numeric suffix (#pcdigits)
http://www.mvps.org/dmcritchie/excel...g.htm#pcdigits
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"dancefle" wrote in message ...
How do I change a column containing c1 c10 c11 c2 c21 c3 to sort as c1 c2 c3
c10 c11 c21?





All times are GMT +1. The time now is 08:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com