Sortofa sorting problem.....

gcanders

New Member
Joined
Oct 30, 2002
Messages
12
I tried to sort the following in Excel, but this is what I got:

1) HD 1694.C2 H83 1992
2) HD 4464.L7 H64
3) HD 4464.L7 K33 1982
4) HD1387 .A663 1996
5) HD259 .H43 1999
6) HD7293 .S675 1999

Line 5 should be before line 4. Is there a way for Excel to do this? By the by - these are card catalog numbers (in case you were curious). Thanks.......
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Have yu tried selecting your range then Data/Sort ?
 

normpam

Active Member
Joined
Oct 30, 2002
Messages
296
The problem is that the numbers in the catalog number are viewed by Excel as text, not values. Since "1" comes before "2", Excel will always sort the 1's first. I don't know all the possible answers, but if the catalog entries can be split up into separate columns (ie: HD in 'A'; 1239 in column 'B" etc) then you could perform the sort operation as you want.
 

gcanders

New Member
Joined
Oct 30, 2002
Messages
12
Yes - I tried doing the data-sort and the results were posted on the original message. I seem to recall this might be a vba problem (by problem, I mean my experience with vba is a bit limited - but I'm happy to learn).
 

gcanders

New Member
Joined
Oct 30, 2002
Messages
12
NORMPAM: The problem with catalog numbers is that I can't simply split them (text to columns), because the letter part of the number varies (i.e. sometimes it's 1 digit, or 2 (as in my example), etc.). Thanks for your reply, though.
 

normpam

Active Member
Joined
Oct 30, 2002
Messages
296
If you would like to send me a sample file, I might be able to come up with a solution.

E-mail:acsadvantage@aol.com
 

Forum statistics

Threads
1,143,752
Messages
5,720,637
Members
422,295
Latest member
Ryamker3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top