sorting decmials

Porknar

Board Regular
Joined
Jan 19, 2006
Messages
59
Is there a way to sort the following:


20.1
20.2
20.10
20.20

as of now it sort these as

20.1
20.10
20.2
20.20

Thanks,
Darrell
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
there's a zero at the end for 20.10 and 20.1 has nothing in the hundredth place..

If it is in text formatting, making a vb code to temporarily change the string into numbers and sorting them wouldn't be an useless idea.
 
Upvote 0
Porknar,

Is the text formmating something that you are want or is it something that you are given and have to put up with? i.e. do you (and the use to which you are putting these numbers) think that 2.10 = 2.1 ?

If so, it would probably pay off in the long run, the data was converted from text formatting to general. TextToColumns is a quick way to do that.
 
Upvote 0
Porknar,

Is the text formmating something that you are want or is it something that you are given and have to put up with? i.e. do you (and the use to which you are putting these numbers) think that 2.10 = 2.1 ?

If so, it would probably pay off in the long run, the data was converted from text formatting to general. TextToColumns is a quick way to do that.

I understand that 2.10 = 2.1, I want to sort as two point 1 and two point ten.

I can format it either way text or general. Will using general allow me to sort in the manner I want?
 
Upvote 0
Getting those out of text format and into General (with numeric entries) will sort them properly.

But after being sorted, you won't be able to tell which was 2.1 and which was 2.10 at the start of it all.

Let me put it another way.
If your original (two columns) data is
3.2 A
2.1 B
1.56 C
2.10 D
convert to numbers and sort will result in
1.56 C
2.1 B
2.1 D
3.2 A

If your original (two columns) data is
3.2 A
2.10 B
1.56 C
2.1 D
convert to numbers and sort will result in
1.56 C
2.1 B
2.1 D
3.2 A

Note that the order of (original data) 2.1 and 2.10 are not changed by "convert to number and sort".
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,497
Messages
6,113,999
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top