Sorting List of Numbers

G

Guest

I am trying to sort account numbers that look something like this (but in a
column, not a row):

18,19,20,30,100,102,105,110,111


To look like this

100,101,102,105,110,111,18,19,20,30

Basically based on the first digit, then second digit, etc instead of
numerically.
Any ideas would be greatly appreciated!
 
D

Dave Peterson

Maybe you could use a helper column, some formulas and sort by that helper
column.

Say your data is A1:Axx
Insert a new column B and use this formula:

=A1&""
and drag down.

Now sort your range by this helper column.

But I'm not sure how you got 101 in that output!!
 
G

Guest

here's one way: insert a helper column next to your column of acct. numbers.

Assuming your data begins in J1, in K1 place this formula:

=IF(J1<100,J1*10,J1) and copy down your range. (now all cells will be a 3
digit number)

Next, highlight the entire range and Sort>Ascending by column K

Finally, delete column K

Your original values are now sorted in your desired order.

HTH
__________________
Bruce
 
G

Guest

here's one way: insert a helper column next to your column of acct. numbers.

Assuming your data begins in J1, in K1 place this formula:

=IF(J1<100,J1*10,J1) and copy down your range. (now all cells will be a 3
digit number)

Next, highlight the entire range and Sort>Ascending by column K

Finally, delete column K

Your original values are now sorted in your desired order.

HTH
__________________
Bruce
 
G

Guest

here's one way: insert a helper column next to your column of acct. numbers.

Assuming your data begins in J1, in K1 place this formula:

=IF(J1<100,J1*10,J1) and copy down your range. (now all cells will be a 3
digit number)

Next, highlight the entire range and Sort>Ascending by column K

Finally, delete column K

Your original values are now sorted in your desired order.

HTH
__________________
Bruce
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top