Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
kailuamike
 
Posts: n/a
Default sorting numbers in a column


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?


--
kailuamike
------------------------------------------------------------------------
kailuamike's Profile: http://www.excelforum.com/member.php...o&userid=29558
View this thread: http://www.excelforum.com/showthread...hreadid=494495

  #2   Report Post  
Posted to microsoft.public.excel.newusers
Max
 
Posts: n/a
Default sorting numbers in a column

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
--
"kailuamike" wrote
in message ...

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?


--
kailuamike
------------------------------------------------------------------------
kailuamike's Profile:

http://www.excelforum.com/member.php...o&userid=29558
View this thread: http://www.excelforum.com/showthread...hreadid=494495



  #3   Report Post  
Posted to microsoft.public.excel.newusers
David McRitchie
 
Posts: n/a
Default sorting numbers in a column

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

"kailuamike" wrote in message
...

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?


--
kailuamike
------------------------------------------------------------------------
kailuamike's Profile: http://www.excelforum.com/member.php...o&userid=29558
View this thread: http://www.excelforum.com/showthread...hreadid=494495



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 Numbers with Multiple Decimals (cont.) Intern Ian Excel Discussion (Misc queries) 5 September 21st 05 12:04 AM
formulas to numbers Steve New Users to Excel 2 September 16th 05 12:07 AM
match and count words David Excel Worksheet Functions 5 July 4th 05 02:24 AM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM
need to find which numbers (3+) in a column sum to a value Devin Excel Discussion (Misc queries) 1 February 11th 05 10:30 PM


All times are GMT +1. The time now is 03:02 AM.

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

About Us

"It's about Microsoft Excel"