Excel 2003 Alphabetic Sort Order Is Not My Idea of Alphabetic

2

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-BDXX
120G-EDXX
120G-MEXX
120G-PRXX
120-SSXX <==== Why is 120-S after 120G-PR?
120T-03XX

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

Keeloid

Posted 2010-02-04T18:59:48.207

Reputation: 81

Answers

3

It ignores the dashes.

Lance Roberts

Posted 2010-02-04T18:59:48.207

Reputation: 7 895

Thanks -- found http://www.mvps.org/dmcritchie/excel/sorting.htm which states the same thing. I guess there may be situations where you want this to happen.

– Keeloid – 2010-02-04T19:23:25.033

2

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.

KarolDepka

Posted 2010-02-04T18:59:48.207

Reputation: 805