Forum Discussion
Sorting Scientific Notation, Alpha, Numeric, and Alphanumeric
Spent much time looking for a way to sort this data set (which is in an Excel worksheet table as part of a much larger dataset) such that it's in order from A to Z and of course all of the rows in the table sort accordingly.
Attempted to:
1. Format the column at "Text" and manually add each string, once cell at a time.
2. Format the column as "Custom" and selected custom format "000" and entered each string manually as well as copy & paste.
3. Use "Text to Columns" with the column containing the data set as the source.
This is how the data set appears after formatting the column as "Text", manually entering each string, and sorting A-Z. Notice that they strings are NOT properly sorted. Scientific Notation seems to be problematic (see string 7E1) and numeric stings are not properly indexed and interleaved with alphanumeric strings:
011
023
034
7E1
085
107
229
270
360
420
501
627
901
09G
0Z5
39Z
3G5
41N
55Q
6DZ
7FF
82A
98E
99R
Interestingly enough, the Excel "Filter" dropdown shows the dataset very nicely indexed in the proper order.
Any ideas on how to accomplish the same as the indexing appears in the Filter dropdown? The actual dataset is MUCH larger than the sample set illustrated here. Any assistance would be greatly appreciated!
PS Using formulas probably (?) won't work because the dataset is in a large table and is just one of the many dynamic sort criteria. In other words, sometimes the table might be sorted on this dataset, other times it may be sorted on other columns, or there might be multiple sort criteria. It's not a matter of just sorting the data for a single instance.
- Hi Hans,
As mentioned in my private message to you, I re-attempted the sort successfully on Excel for the web and another PC that is running a different build of Excel desktop. So it appears that the sort issue has something to do with the Excel desktop build on my other PC.
Thank you again for your time and expertise!
4 Replies
Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar?
- trs1111Copper Contributor
Hi Hans,
Thanks for taking a look at this. The sample below is purely fictious, but somewhat representative of the full dataset. I don't see an option to attach this as file and not able to send a link for OneDrive, Google Drive, Dropbox, etc. Hopefully you can work with this sample. The sorting on the "Code" column in the table is the issue.
Description Code Inventory Qty. Cost Gloves, Black - Small 011 28 $3.99 Gloves, Black - Medium 023 40 $4.99 Gloves, Black - Large 034 29 $5.99 Gloves, Brown - Small 7E1 310 $3.99 Gloves, Brown - Medium 085 11 $4.99 Gloves, Brown - Large 107 54 $5.99 Gloves, Blue - Small 229 23 $3.99 Gloves, Blue - Medium 270 54 $4.99 Gloves, Blue - Large 360 71 $5.99 Gloves, Red - Small 420 94 $3.99 Gloves, Red - Medium 501 5 $4.99 Gloves, Red - Large 627 44 $5.99 Gloves, White - Small 901 63 $3.99 Gloves, White - Medium 09G 741 $4.99 Gloves, White - Large 0Z5 45 $5.99 Mittens - Orange 39Z 55 $2.99 Mittens - Red 3G5 9 $2.99 Mittens - Blue 41N 72 $2.99 Mittens - Green 55Q 34 $2.99 Mittens - Yellow 6DZ 45 $2.99 Mittens - Black 7FF 16 $2.99 Mittens - Purple 82A 112 $2.99 Mittens - Pink 98E 33 $2.99 Mittens - White 99R 4 $2.99 I pasted your sample data into an Excel sheet formatted as text, then sorted on the Code column:
Perhaps you can attach a sample workbook in a private message to me (click on my user picture)