I have an Excel 2003 spreadsheet that I'm sorting on the first column, which is formatted as Text. The sort order is strange. Here's a "sorted" example. I've highlighted the anomaly.
120-SSXX <==== Why is 120-S after 120G-PR?

Am I missing something or does Excel define alphabetical order differently than most people?


It ignores the dashes.


Maybe you should create separate columns on which to sort and then sort on multiple columns.
1. the column that has "120" etc.
2. the column that has or has not "G" etc.
3. the column that has "BDXX" etc
This would also make things like filtering, pivot tables, viable. I would do that. Either manually or by a VBA macro using regexp. Hope that helps you arrive at a useful and flexible solution. Don't get into a trap of working with convoluted data packed into one string.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.