Formula Advice on Sorting Decimal Values from lowest value to Highest value

VBA learner ITG

Active Member
Joined
Apr 18, 2017
Messages
267
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi Peers,

I appreciate this may have been asked before but i am having issues sorting values with decimal points from low to high.

In Column A I have decimal values and in column B i have applied this formula to help with the sortation: =INT(A2)&"."&TEXT(RIGHT(A2,LEN(A2)-(FIND(".",A2))),"000")

The issue it is having is when the value is for example 1.10 it shows thew value as 1.001 when it should be 1.010

Any advice appreciated on how to resolve my issue?



CUSTOMER SEQUENCESORT SEQUENCE WITH FORMULA
1.11.001
1.21.002
1.31.003
1.41.004
1.51.005
1.61.006
1.71.007
1.81.008
1.91.009
1.11.001
1.111.011
1.121.012
1.131.013
1.141.014
1.151.015
1.161.016
1.171.017
1.181.018
1.191.019
1.21.002
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
So are you saying that the first 1.1 a the top of the list should be 1.001, but the second 1.1 that you've highlighted should be 1.010?

Unless there is something else in data to help identify which is which, what you are asking will not be possible. You can not have identical values with different values if you want to sort them. Anything that does appear to work would be too error prone to be useful.

This formula is an answer based on the limited information provided, but it is definitely not a solution.'
Excel Formula:
=INT(A2)+TEXT(COUNTIF(A$2:A2,">="&INT(A2)),"""0.""000")
 
Last edited:
Upvote 0
not 100% sure what you are trying to achieve
1.1 = 1.01
but
1.2 = 1.002
1.3 = 1.003
AND
1.18 = 1.018

So depending on how many decimal places you have depends on if adding 1 or 2 zeros

1.21 = 1.021
1.33 = 1.033
BUT
1.20 = 1.002
1.30 = 1.003
 
Upvote 0
as numbers, 1.10 = 1.1
as strings "1.10" <> "1.1"
The problem isn't with the formlua, but that column A are numbers not strings.
 
Upvote 0
So are you saying that the first 1.1 a the top of the list should be 1.001, but the second 1.1 that you've highlighted should be 1.010?

Unless there is something else in data to help identify which is which, what you are asking will not be possible. You can not have identical values with different values if you want to sort them. Anything that does appear to work would be too error prone to be useful.
Yes you are correct when i enter 1.1 it shows as 1.1 and when i enter on the row i mentioned 1.10 it shows as 1.1 even converting to decimal places doesnt work.
 
Upvote 0
not 100% sure what you are trying to achieve
1.1 = 1.01
but
1.2 = 1.002
1.3 = 1.003
AND
1.18 = 1.018

So depending on how many decimal places you have depends on if adding 1 or 2 zeros

1.21 = 1.021
1.33 = 1.033
BUT
1.20 = 1.002
1.30 = 1.003
Yes you are correct when i enter 1.1 it shows as 1.1 and when i enter on the row i mentioned 1.10 it shows as 1.1 even converting to decimal places doesnt work and even when i apply the helper formula
 
Upvote 0
do you want this
=INT(A2)+MOD(A2,1)/10

Book2
ABC
1CUSTOMER SEQUENCESORT SEQUENCE WITH FORMULA
21.11.0011.01
31.21.0021.02
41.31.0031.03
51.41.0041.04
61.51.0051.05
71.61.0061.06
81.71.0071.07
91.81.0081.08
101.91.0091.09
111.11.0011.01
121.111.0111.011
131.121.0121.012
141.131.0131.013
151.141.0141.014
161.151.0151.015
171.161.0161.016
181.171.0171.017
191.181.0181.018
201.191.0191.019
211.21.0021.02
Sheet1
Cell Formulas
RangeFormula
C2:C21C2=INT(A2)+MOD(A2,1)/10
 
Upvote 0
The only way to achieve what i want is to convert the column to a text string instead of the current numerical
do you want this
=INT(A2)+MOD(A2,1)/10

Book2
ABC
1CUSTOMER SEQUENCESORT SEQUENCE WITH FORMULA
21.11.0011.01
31.21.0021.02
41.31.0031.03
51.41.0041.04
61.51.0051.05
71.61.0061.06
81.71.0071.07
91.81.0081.08
101.91.0091.09
111.11.0011.01
121.111.0111.011
131.121.0121.012
141.131.0131.013
151.141.0141.014
161.151.0151.015
171.161.0161.016
181.171.0171.017
191.181.0181.018
201.191.0191.019
211.21.0021.02
Sheet1
Cell Formulas
RangeFormula
C2:C21C2=INT(A2)+MOD(A2,1)/10

In row 11 of your example the value should be 1.10 and not 1.01 and row 21 should be 1.20 and not 1.02

I have converted the values to be stored as text and it works.

CUSTOMER SEQUENCESORT SEQUENCE
'1.11.01
'1.21.02
1.31.03
'1.41.04
'1.51.05
'1.61.06
'1.71.07
'1.81.08
'1.91.09
'1.101.10
'1.111.11
'1.121.12
'1.131.13
'1.141.14
'1.151.15
'1.161.16
'1.171.17
'1.181.18
'1.191.19
'1.201.20
 
Upvote 0
1.10 = 1.1
They are exactly the same number.

Yes you are correct but when i am trying to sort the values of 1.1 and 1.10 the sortation becomes incoprrect because 1.10 shouldnt be groued with 1.1 in the first row of my data.
 
Upvote 0

Forum statistics

Threads
1,215,563
Messages
6,125,565
Members
449,237
Latest member
Chase S

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