Sorting data that is a combination of text and numbers, and of varying lengths
Posted by Tim on May 06, 2001 9:31 PM
I am having problems sorting data alpha-numerically. For Example:
This is the result of an ascending sort function of a particular column of data.
CE1
CE10
CE4
R14
R2
R4
R5
I want the result to be:
CE1
CE4
CE10
R2
R4
R5
R14
What are the different ways to format the data so that it sorts according to my needs?
I can think of two ways, but do not know how to actually carry out these ideas:
1) Separate the alpha characters from the numerics - put in two columns - then sort the two columns accordingly
2)Convert the data to a specific string length by adding the leading zeros, and then sort (i.e. modify R2 to R002)
Any other suggestions, with solutions of course.
Thanks much.