Columns not sorting properly.

S

StargateFan

I'm stumped on this one - I had it happen once before but I don't
recall the fix. When I sort either manually or programmatically via a
recorded script, by name, there's a break in the sort so that I get 2
groups of alphabetically sorted names. In other words, half the
column is sorted A to Z and then after a name beginning with X, then
below that another group starts A-Z. I checked the format of the
celsl and they're all General. I removed all other sorts so as to
just leave either FIRST NAME, LAST NAME sort and tried going back and
forth but the columns remain badly sorted as described.

Anyone know what is the cause of this type of thing?

Thx. :eek:D
 
D

Don Guillett

I'm stumped on this one - I had it happen once before but I don't
recall the fix.  When I sort either manually or programmatically via a
recorded script, by name, there's a break in the sort so that I get 2
groups of alphabetically sorted names.  In other words, half the
column is sorted A to Z and then after a name beginning with X, then
below that another group starts A-Z.  I checked the format of the
celsl and they're all General.  I removed all other sorts so as to
just leave either FIRST NAME, LAST NAME sort and tried going back and
forth but the columns remain badly sorted as described.

Anyone know what is the cause of this type of thing?

Thx.  :eek:D

Perhaps a TRIM would help. If all else fails, send to me at dguillett1
@gmail.com.
 
S

StargateFan

Perhaps a TRIM would help. If all else fails, send to me at dguillett1
@gmail.com.

Wow, thanks! I never would have figured that out. Sure enough, I hd
extra spaces before the data in both columns. I copy/pasted the data
in the original sheet; then, on top of that, I discovered the text to
columns feature that I never knew anything about so that the original
LAST NAME, FIRST NAME was split into 2 columns. Something I didn't
anticipate, I told Excel to use the comma as the splitting criteria
(",") but I now strongly suspect I needed to use ", " including the
space. I'll test this out sometime to see if that was truly the
cause.

I couldn't figure out the TRIM thing and since I was rushed for time
just quickly went through and manually erased all the extra spaces.
Surprisingly, lots of websites talk about TRIM but none mentioned the
actual logistics. I suspect you have to add an extra column and
reference the faulty one with TRIM then probably you need to
copy/paste as values and then get rid of the original column(s). That
was too much work in the time I had to test, though. Someone seems to
have come up with a neat-looking TRIM add-in but that still seems to
leave a TRIM("A1") type column of data to deal with. Don't know if a
macro would have been best bet if I hadn't fixed this manually.

I'll know next time to to check for extra spaces if anything sorts
weird ever again. I really was going nuts because I just couldn't
figure out the cause. So thanks tons for the help. As always you
guys save the day and make us look competent in our Excel use at work
<lol><sigh>.
 

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