Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2005

Tip: Looking for answers? Try searching our database.

sorting numbers in a column

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kailuamike - 19 Dec 2005 00:50 GMT
Problem:  The numbers I am sorting are composed of various numbers of
integers, some having four digits, others five or six, and so on.  I
would like to have them sort by number regardless of number of digits.
Will Excel let me do this?  
example:  presently it looks like this:
3004
12001656
530393505
2200498378

and I really want it to sort like this:
12001656
2200498378
3004
530393505

Can this be done?

Signature

kailuamike

Max - 19 Dec 2005 01:11 GMT
One way is to use a helper col to convert the col of numbers to text,
then sort both cols by the helper col

Assume the numbers are in A1 down
Put in B1, copy down: =TEXT(A1,"@")
Now sort both cols A & B by col B, ascending
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--

> Problem:  The numbers I am sorting are composed of various numbers of
> integers, some having four digits, others five or six, and so on.  I
[quoted text clipped - 19 lines]
> kailuamike's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=29558
> View this thread: http://www.excelforum.com/showthread.php?threadid=494495
David McRitchie - 19 Dec 2005 02:58 GMT
Hi Kailua,
A user defined function as follows will convert everything
to text and allow for leading zeros which you have not shown.

Function ShowAsText(cell) returns string
  ShowAsText  = "'" & cell.text      'single quote within double quotes
End Function

B1 =  ShowAsText(A1)
 or
B1 =  personal.xls!ShowAsText(A1)

Would suggest formatting the B column as text,  but the above
function will  precede by a single quote so you don't have to format
as text before using the fill handle to fill down.
---
HTH,
David McRitchie, Microsoft MVP - Excel    [site changed  Nov. 2001]
My Excel Pages:  http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page:        http://www.mvps.org/dmcritchie/excel/search.htm

> Problem:  The numbers I am sorting are composed of various numbers of
> integers, some having four digits, others five or six, and so on.  I
[quoted text clipped - 13 lines]
>
> Can this be done?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.