Sorting Decimal Style Numbers

beachie2037

New Member
Joined
Jan 6, 2005
Messages
21
Hi All,

Scratching my head trying to sort a large file based on a column of decimal style numbers that has been exported from another application.

I am on Win 7 running Excel 2010

Numbering sequence should be:
1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 1.11, 1.12

but I have it all jumbled up and when I try to sort it I get:
1, 1.1, 1.11, 1.12, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,

As is through hundreds of numbers on a number of sheets I dont really want to resort it all by hand!

Any ideas or suggestions greatly appreciated.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
You could try adding a helper column with the following pasted down, and sort by that column.

=INT(A1)&"."&TEXT(RIGHT(A1,LEN(A1)-(FIND(".",A1))),"000")

should turn
1.1 into 1.001
and 1.11 into 1.011
 
Upvote 0
Or possibly just use RANK. In B1:

=RANK(A1,$A$1:$A$20)

Fill down to B20. Sort columns A & B by column B descending.
 
Upvote 0
Looking at my post again, the formula I provided will error if there is no decimal point. Try the following instead:
=IF(ISERROR(FIND(".",A1)),A1,INT(A1)&"."&TEXT(RIGHT(A1,LEN(A1)-(FIND(".",A1))),"000"))

As for using the Rank formula. If I understand the problem correctly, The Rank Function will rank also assume 1.9 > 1.11.
 
Upvote 0
I have a similar issue with a large list of drawing names.

Code:
[TABLE="width: 64"]
 <colgroup><col width="64" style="width:48pt"> </colgroup><tbody>[TR]
  [TD="width: 64"]A0-0A[/TD]
 [/TR]
 [TR]
  [TD]A2-0[/TD]
 [/TR]
 [TR]
  [TD]A2-1.1[/TD]
 [/TR]
 [TR]
  [TD]A2-1.10[/TD]
 [/TR]
 [TR]
  [TD]A2-1.11[/TD]
 [/TR]
 [TR]
  [TD]A2-1.12[/TD]
 [/TR]
 [TR]
  [TD]A2-1.13[/TD]
 [/TR]
 [TR]
  [TD]A2-1.14[/TD]
 [/TR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]
  [TD]S2-1.14[/TD]
 [/TR]
 [TR]
  [TD]S2-1.15[/TD]
 [/TR]
 [TR]
  [TD]S2-1.16[/TD]
 [/TR]
 [TR]
  [TD]S2-1.17[/TD]
 [/TR]
 [TR]
  [TD]S2-1.18[/TD]
 [/TR]
 [TR]
  [TD]S2-1.19[/TD]
 [/TR]
 [TR]
  [TD]S2-1.2[/TD]
 [/TR]
 [TR]
  [TD]S2-1.20[/TD]
 [/TR]
 [TR]
  [TD]S2-1.4[/TD]
 [/TR]
 [TR]
  [TD]S2-1.5[/TD]
 [/TR]
 [TR]
  [TD]S2-1.6[/TD]
 [/TR]
 [TR]
  [TD]S2-1.7[/TD]
 [/TR]
 [TR]
  [TD]S2-1.8[/TD]
 [/TR]
 [TR]
  [TD]S2-1.9[/TD]
 [/TR]
 [TR]
  [TD]S2-2[/TD]
 [/TR]
 [TR]
  [TD]S2-3[/TD]
 [/TR]
 [TR]
  [TD]S3-1[/TD]
 [/TR]
 [TR]
  [TD]S3-2[/TD]
 [/TR]
 [TR]
  [TD]S3-3[/TD]
 [/TR]
 [TR]
  [TD]S3-4[/TD]
 [/TR]
 [TR]
  [TD]V0-1[/TD]
 [/TR]
 [TR]
  [TD]V0-2[/TD]
 [/TR]
 [TR]
  [TD]V0-3[/TD]
[/TR]
</tbody>[/TABLE]

The order in which Excel sorted them is incorrect. Those with actual decimals should be listed in order, such as 1.9, 1.10, 1.11, 1.12, etc. Not 1.1, 1.10. 1.11...1.19, 1.2, 1.20, etc.

I don't quite see how the solutions here help, but maybe I am missing something.

Thanks,
Chris
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,497
Members
448,967
Latest member
visheshkotha

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