Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
couriced
 
Posts: n/a
Default Help with sorting!


Hello,

Is there an easy way to sort a list with varying lengths of data?

We have a column that has data in the cells that are say 4-9 characters
in length. What currently happens when we sort is it sorts all the 4
character length entries first, then the 5 character entries, and so
on. We would like to sort it so it is alphanumeric based on the
characters it contains...regardless of length.

Thanks in advance!


--
couriced
------------------------------------------------------------------------
couriced's Profile: http://www.excelforum.com/member.php...o&userid=26900
View this thread: http://www.excelforum.com/showthread...hreadid=475956

  #2   Report Post  
swatsp0p
 
Posts: n/a
Default


Shouldn't happen that way, can you give some specific cell contents to
evaluate?

If I have the following in a column:

1abc
2ab
b412
1a
'4 (a text entry)
b2135
and sort Ascending, I get:

1a
1abc
2ab
4
b2135
b412

What are you getting?


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=475956

  #3   Report Post  
couriced
 
Posts: n/a
Default


Yes, agreed. When I do a quick sample myself...I get the same result as
you. User just emailed me their workbook...and it will only sort this
way:

BO33
AT283
AT384
AT386
AT645
AT651
DA008
DAA&M
NY321
NY548
NY585
NY950
PH258
PH259
PH261
PH262
PH263
PH264
PH266
PH267
PH268
PH269
PH272
PH560
AT1060
AT1061

I have tried just copying this one column out of the workbook and
pasting to its own and formatting it as text to try...it just won't...


--
couriced
------------------------------------------------------------------------
couriced's Profile: http://www.excelforum.com/member.php...o&userid=26900
View this thread: http://www.excelforum.com/showthread...hreadid=475956

  #4   Report Post  
couriced
 
Posts: n/a
Default


Ok..after playing around with the users file...I have discovered why it
won't sort...which opens a new problem. This data was an export from
elsewhere. Not obvious at first glance is that these values all have a
random number of spaces before them. When I goto the cell and delete
the space that precedes the actual data...then resort...that particular
cell then falls in place where we want in a sort. Now...how do we delete
a random number of spaces before each piece of data. Looks like there's
2-4 of them.


--
couriced
------------------------------------------------------------------------
couriced's Profile: http://www.excelforum.com/member.php...o&userid=26900
View this thread: http://www.excelforum.com/showthread...hreadid=475956

  #5   Report Post  
swatsp0p
 
Posts: n/a
Default


in a helper column use the TRIM function, e.g.

=TRIM(A1)

"__1234" will become "1234" (leading spaces removed)

Good Luck


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=475956



  #6   Report Post  
couriced
 
Posts: n/a
Default


Bingo...TY!


--
couriced
------------------------------------------------------------------------
couriced's Profile: http://www.excelforum.com/member.php...o&userid=26900
View this thread: http://www.excelforum.com/showthread...hreadid=475956

  #7   Report Post  
swatsp0p
 
Posts: n/a
Default


I'm glad it worked for you. Thanks for the feedback, it is always
appreciated.

Cheers!


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=475956

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sorting non contiguous ranges gsh20 Excel Discussion (Misc queries) 1 September 8th 05 04:50 PM
Advice sought: Multiple column sorting davidm Excel Worksheet Functions 3 July 29th 05 02:06 PM
Sorting 1, 1A, 2, 2A, 3, 4, 4A, 4B . . . agc1234 Excel Discussion (Misc queries) 6 May 26th 05 08:02 PM
sorting number in ascending order Janice Lee via OfficeKB.com Excel Discussion (Misc queries) 2 April 8th 05 10:31 PM
Adding a KeyID column for sorting Rebecca New Users to Excel 3 February 20th 05 07:09 PM


All times are GMT +1. The time now is 08:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"