sorting numbers with hyphens in excel

M

mb-76

I am trying to sort a list of numbers, some of which contain hyphens. For
example I want to sort "65,66,66-1,67-1,68,69". Excel sorts it out as
"65,66,68,69,66-1,67-1". What I want it to give me is
"65,66,66-1,67-1,68,69". Any ideas on how to do this in a simple manner? I
have had some ideas thrown at me but they are all rather involved and I would
like to be able to sort in this manner often. Thanks.
 
L

Luke M

First, convert all your data to text. Various ways of doing this, a quick
way is to use the formula:
=TEXT(A1,"@")
and then do a copy, paste special - values
Next, select your data, sort, ascending, and choose "sort numbers as text"
option. Otherwise, XL will sort all the numbers first, and then all the text
strings.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top