Formula to change the decimal numbers

NewbieAU

New Member
Joined
Oct 25, 2021
Messages
6
Office Version
  1. 2019
Platform
  1. Windows
Hi everyone. I have a question to ask if it's possible.

I have a set of numbers with decimal points. I have to sort them in ascending order, then remove the "gaps" in the decimal points.

OriginalSorted in ascending orderModified
1.13​
1.01​
1.01​
1.02​
1.02​
1.02​
1.04​
1.04​
1.03​
1.01​
1.13​
1.04​
2.13​
2.01​
2.01​
2.02​
2.02​
2.02​
2.04​
2.04​
2.03​
2.01​
2.13​
2.04​

For example, in the sorted section, we have a "gap" between 1.02 and 1.04. I need to change the 1.04 to 1.03 so there is no skipping. Similarly, 1.13 then becomes 1.04.

The "main numbers" (ones and tens etc) cannot be changed - only the decimal section. How can I go about doing this?

Thanks in advance.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
I just realized the above example wasn't great in that in both instances, we have .04 and .13 that becomes .03 and .04 respectively. This may not always be the case :(
 
Upvote 0
This is absolutely perfect! Thank you for understanding exactly what I was trying to do. I got so confused towards the end while manually changing the numbers. I really appreciate this!

Thank you again!
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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