Sorting 1, 2, 10, 20 to 1, 10, 2, 20

C

Caroline

I am trying to sort a list of articlenumbers, example:
1, 2, 10, 22, 202.

I want to sort it like: 1, 10, 2, 202, 22.

Can anyone tell me how to do that?

Thank you in advance!!
 
T

Tom Ogilvy

since it isn't sorting them that way as the default, then I assume they are
stored as numbers rather than text. In an adjacent column, put in a formula
like (assume the first number is in B2)
C2: =Text(B2,"#")
then drag fill down the column.

Select the rows you want to sort and sort your data using column C as the
sort key.
 
M

MartinW

Hi Caroline,

Say your data is in column A.
Insert a helper column and in B1 put ="."&A1 and drag
down to the end of your data, this will convert it to .1, .2, .10,
..202 etc.
Then sort on column B ascending, and then delete column B

HTH
Martin
 
M

Max

Use a helper col to change the numbers to text, then sort both ascending by
the helper col using "Sort numbers and numbers stored as text separately"

Assuming source numbers in A1 down
Put in B1: =A1&""
Copy down
Then select both cols A and B, sort by col B > ascending > Sort numbers and
numbers stored as text separately > OK
 
C

Caroline

Thank you!
My boss will love me :)

"Max" skrev:
Use a helper col to change the numbers to text, then sort both ascending by
the helper col using "Sort numbers and numbers stored as text separately"

Assuming source numbers in A1 down
Put in B1: =A1&""
Copy down
Then select both cols A and B, sort by col B > ascending > Sort numbers and
numbers stored as text separately > OK
 

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