Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

It ignores the dashes.

share|improve this answer
Thanks -- found which states the same thing. I guess there may be situations where you want this to happen. – Keeloid Feb 4 '10 at 19:23

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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .