Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Sort by number only in cell

I have files with a bunch of cells with mixed number/text information. I
would like to sort by the number only.

Each cell contains a 1-3 digit number, and 0-2 letters in some combination
of prefix and suffix.

For example, a list might be:
3
A100C
A100D
AB205
B4
53DE

And I would like it sorted by the number only. Actually, I would like it
sorted by the number, then the suffix, then the prefix, but the number is a
big step in that direction...

Thank you :)
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Sort by number only in cell

On Wed, 15 Jul 2009 15:46:01 -0700, serendipity258
wrote:

I have files with a bunch of cells with mixed number/text information. I
would like to sort by the number only.

Each cell contains a 1-3 digit number, and 0-2 letters in some combination
of prefix and suffix.

For example, a list might be:
3
A100C
A100D
AB205
B4
53DE

And I would like it sorted by the number only. Actually, I would like it
sorted by the number, then the suffix, then the prefix, but the number is a
big step in that direction...

Thank you :)


Set up three blank columns to one side of your data.

Label your columns:
Data Number Prefix Suffix

Assuming your Data starts in A2, enter the following formulas to extract the
parts of the data:

Number:
=LOOKUP(9.9E+307,--MID(A2,MIN(FIND({1,2,3,4,5,6,7,8,9,0},A2&"1,2,3,4, 5,6,7,8,9,0")),ROW(INDIRECT("1:"&LEN(A2)))))

Prefix:
=LEFT(A2,MIN(FIND({1,2,3,4,5,6,7,8,9,0},A2&"1,2,3, 4,5,6,7,8,9,0"))-1)

Suffix:
=MID(A2,LEN(B2)+LEN(C2)+1,255)

Then select the formulas and fill down as far as your data extends.

Finally, with a selection in the table range, or after selecting the table:

Data/Sort
First by Number
Then by Suffix
Then by Prefix
--ron
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 39
Default Sort by number only in cell

Microsoft has a ready-rolled array formula:

http://office.microsoft.com/en-gb/ex...549011033.aspx

Don't forget Ctrl-Shift-Enter


?B?c2VyZW5kaXBpdHkyNTg=?=
wrote in :

3
A100C
A100D
AB205
B4
53DE


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
Number sort in Excel AnitaG Excel Discussion (Misc queries) 3 February 6th 09 04:35 PM
Sort by part of a number sacredarms New Users to Excel 2 July 25th 06 06:48 PM
Sort by number not by letter (C1, A2, B3, D4) dukemeiser Excel Discussion (Misc queries) 3 May 5th 06 02:40 AM
sort by section number alslm Excel Discussion (Misc queries) 1 April 14th 05 04:55 PM
Excel Sort function should not sort the cell formatting! Lisa D.N.1 Excel Worksheet Functions 1 December 28th 04 08:37 PM


All times are GMT +1. The time now is 12:53 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"