close

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: www.excelforum.com/member.php...oamp;userid=29558
View this thread: www.excelforum.com/showthread...hreadid=494495One 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,quot;@quot;)
Now sort both cols A amp; B by col B, ascending
--
Rgds
Max
xl 97
---
Singapore, GMT 8
xdemechanik
savefile.com/projects/236895
--
quot;kailuamikequot; gt; wrote
in message ...
gt;
gt; Problem: The numbers I am sorting are composed of various numbers of
gt; integers, some having four digits, others five or six, and so on. I
gt; would like to have them sort by number regardless of number of digits.
gt; Will Excel let me do this?
gt; example: presently it looks like this:
gt; 3004
gt; 12001656
gt; 530393505
gt; 2200498378
gt;
gt; and I really want it to sort like this:
gt; 12001656
gt; 2200498378
gt; 3004
gt; 530393505
gt;
gt; Can this be done?
gt;
gt;
gt; --
gt; kailuamike
gt; ------------------------------------------------------------------------
gt; kailuamike's Profile:
www.excelforum.com/member.php...oamp;userid=29558
gt; View this thread: www.excelforum.com/showthread...hreadid=494495
gt;
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 = quot;'quot; amp; 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: www.mvps.org/dmcritchie/excel/excel.htm
Search Page: www.mvps.org/dmcritchie/excel/search.htm

quot;kailuamikequot; gt; wrote in message
...
gt;
gt; Problem: The numbers I am sorting are composed of various numbers of
gt; integers, some having four digits, others five or six, and so on. I
gt; would like to have them sort by number regardless of number of digits.
gt; Will Excel let me do this?
gt; example: presently it looks like this:
gt; 3004
gt; 12001656
gt; 530393505
gt; 2200498378
gt;
gt; and I really want it to sort like this:
gt; 12001656
gt; 2200498378
gt; 3004
gt; 530393505
gt;
gt; Can this be done?
gt;
gt;
gt; --
gt; kailuamike
gt; ------------------------------------------------------------------------
gt; kailuamike's Profile: www.excelforum.com/member.php...oamp;userid=29558
gt; View this thread: www.excelforum.com/showthread...hreadid=494495
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()