View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default Excel sort ( exclude letters include hyphens)?

So, 05 is sorted before 002 because it has only 2 digits?

When you have (effectively, after ignoring the characters) 05-024,
05-543 and 05-678, these are sorted as text values (and just happen to
be in numerical order as well)? I don't think you can just ignore the
digits after the hyphen, otherwise you may end up with 05-543, 05-678
and 05-024.

Pete

On Jul 1, 5:09*pm, always confused
wrote:
it should look like the list that I gave. so that anything after the hyphen
is ignored. and even though the numerical value of 002 is less than 05, 05
should come before 002

05-024
AB05-543
05-678
002-23

I hope I explained myself a little better.



"Pete_UK" wrote:
When you say "then by value" do you mean the numerical value of
numbers to the right of the hyphen, or the value of those numbers to
the left?


In your example data, what would you expect the resulting order to be
after sorting according to your rules?


Pete


On Jul 1, 4:14 pm, always confused <always
wrote:
I'm trying to use the sort comand on excel so that my list looks like this
05-024
AB05-543
05-678
002-23


What was asked of me is to sort the list so that letters are not taken into
consideration and so that it is sorted by the number of digits to the left of
the hyphen then by value.
Does anyone know how to do this?- Hide quoted text -


- Show quoted text -