#1   Report Post  
Arturo
 
Posts: n/a
Default Alphanumeric Sort

I have a range of unique identifiers A1 through A500.
I sort on a different column then need to resort on those unique identifiers.
How do I prevent
a1
a10
a100
a101
a102
a103
a104
a105
a106
a107
a108
a109

When it should be
a1
a2
a3
a4
a5
a6
a7
a8
a9


Thanks,
Arturo
  #2   Report Post  
Dave O
 
Posts: n/a
Default

Because the entries start with "a", Excel interprets the entire cell
and each of the cell's components as text. Even though the cells
contain numbers, Excel sorts them textually, and "103" appears before
"2" in an alpha sorted list.

If the format of your entries is alpha-#-#-# then one way to sort the
list is to write this formula for each entry in column B:
=Mid(A1,1,1)

.... and this entry in column C:
=value(mid(A1,2,len(A1))

Then sort simultaneously on columns B and C.

  #3   Report Post  
Myrna Larson
 
Posts: n/a
Default

And, for completeness, the other way is to use leading zeroes in the numeric
portion of the data in column a, i.e. A003 rather than A3

On 2 Mar 2005 09:33:50 -0800, "Dave O" wrote:

Because the entries start with "a", Excel interprets the entire cell
and each of the cell's components as text. Even though the cells
contain numbers, Excel sorts them textually, and "103" appears before
"2" in an alpha sorted list.

If the format of your entries is alpha-#-#-# then one way to sort the
list is to write this formula for each entry in column B:
=Mid(A1,1,1)

... and this entry in column C:
=value(mid(A1,2,len(A1))

Then sort simultaneously on columns B and C.


  #4   Report Post  
Gord Dibben
 
Posts: n/a
Default

Arturo

Easiest would be to have another column with the numbers 1 - 500

Sort on that column to get original order back.


Gord Dibben Excel MVP

On Wed, 2 Mar 2005 09:03:03 -0800, Arturo
wrote:

I have a range of unique identifiers A1 through A500.
I sort on a different column then need to resort on those unique identifiers.
How do I prevent
a1
a10
a100
a101
a102
a103
a104
a105
a106
a107
a108
a109

When it should be
a1
a2
a3
a4
a5
a6
a7
a8
a9


Thanks,
Arturo


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
How do I sort by row instead of by column? PercivalMound Excel Worksheet Functions 7 August 28th 06 10:41 PM
Alphanumeric Sort Ray Excel Discussion (Misc queries) 5 May 20th 05 08:02 PM
"-" ignored in sort Mike H Excel Discussion (Misc queries) 8 January 2nd 05 07:48 AM
Excel Sort function should not sort the cell formatting! Lisa D.N.1 Excel Worksheet Functions 1 December 28th 04 08:37 PM
Data > Sort function amnesia? Dave D Excel Discussion (Misc queries) 1 November 29th 04 10:44 PM


All times are GMT +1. The time now is 01:39 AM.

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"