Macro To Sort Data Required

Older Excel Learner

New Member
Joined
Feb 3, 2018
Messages
12
BEFORE
Col ACol BCol CCol DCol ECol FCol GCol HCol ICol JCol K
Row 9 12.133.20.30.414.525.617.70.80.9
Row 10 41.133.233.325.429.538.617.733.80.9
Row 11 BlankBlankBlankBlankBlankBlankBlankBlankBlank
Row 12 BlankBlankBlankBlankBlankBlankBlankBlankBlank
Row 13 17.1Blank0.30.40.533.625.70.80.9
Row 14 50.1Blank0.333.425.533.625.733.80.9
Row 15 0.1Blank0.30.40.5BlankBlankBlankBlank
Row 16 0.1Blank0.30.40.5BlankBlankBlankBlank
AFTER
Col ACol BCol CCol DCol ECol FCol GCol HCol ICol JCol K
Row 9 33.225.617.714.512.10.90.80.40.3
Row 10 41.138.633.833.333.229.525.417.70.9
Row 11 BlankBlankBlankBlankBlankBlankBlankBlankBlank
Row 12 BlankBlankBlankBlankBlankBlankBlankBlankBlank
Row 13 33.625.717.10.90.80.50.40.3Blank
Row 14 50.133.833.633.425.725.50.90.3Blank
Row 15 0.50.40.30.1BlankBlankBlankBlankBlank
Row 16 0.50.40.30.1BlankBlankBlankBlankBlank

<colgroup><col span="12"></colgroup><tbody>
</tbody>

<tbody>
</tbody>

Hello All, I am new to Excel and have hit a problem that I require help with. I have tried Custom Sort within Excel but it does not do what I require.

The figures above represent two seperate/different numbers within the same cell each seperated by a . (full stop)

The first number before the . represents an individuals score (always between 0 and 100 inclusive)

The second number after the . represents a number assigned to an individual (currently 9 of us golfers)

The data range is C9:K302 . Each row has no bearing to any other row, so the sorting should begin in C9:K9, then start again in C10:K10 and so on down to the last row C302:K302

The data should be sorted by the numbers BEFORE the full stop , going from left to right, by highest, then zeroes, then blanks as above example.

It doesn't really matter if 2 players have the same score and it puts 33.2 in the cell before 33.1 or if it sorts 0.1 after 0.5, it would be nice if it went from player 1 to player 9, but highest then zeroes, then blanks in any player sequence will suffice.

All cells have formulas in them importing the data from another workbook, all have the same Conditional formatting and all are classified as General cells.

Thanks in advance for any help forthcoming.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Is it anything to do with 100 being a 3 digit number I wonder.

Not if they're actually numbers. Text with numbers on the other hand can sort inconsistently (try sorting the cells containing the text Row 9, Row 10, Row 11 to see). Text will also have a higher sort value than numbers, and blanks will be last in either direction.
 
Last edited:
Upvote 0
Col C Col D Col E Col F Col G Col H Col I Col J Col K Col L

Row 9 7.1 20.2 64.3 40.4 1.5 10.6 100.7 Blank 0.9 9.10 Data Before running macro


Row 9 100.7 64.3 40.4 20.2 10.6 9.10 7.1 1.5 0.9 Blank Required after running macro


Hi sheetspread, thanks for sticking with me, when single digit scores are in a cell in the range, they cause a further problem by being ranked ahead of double digit numbers with the 100 being placed last just ahead of zero and blank using the current macro.

Could you please have a fresh look using the data above and see if you could come up with a new macro to try and solve it or even get close to above

My cells are GENERAL format and can't be NUMBER format as then when a tenth player as above is added the 2 decimal places will make player 1 become player 10 also.

The data still starts in C9 but above has 10 players instead of old macro accounting for 9, so the Range end is now L302

Thank you so much.
 
Upvote 0
They sorted fine in my test, with the general format, what order are you getting? Are these numbers entered by you or downloaded from somewhere? Is the column width affecting the results? Is there any kind of text in the cell (including ="")?
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,249
Members
449,075
Latest member
staticfluids

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