Improper sorting of text using custom sort list

Copper Contributor

I have two columns; column A is formatted as text and consists of a word followed by a space, then numbers (1-3 digits), column B is numeric. I want to sort by column A using a custom list rather than alphabetic because of the way Excel handles numbers when they are text and I want things grouped in a certain way. I set up the custom list and this looks fine. For some reason, two of the rows (colon 3 and TI 443) will not fall into the correct custom order. They will sort fine A to Z but it's as if excel is sorting those two alphabetically rather than by custom list. So colon 3 gets placed after colon 264 instead of after colon 2 like I want it.

I have made sure there are no hidden rows/columns, no leading or hidden digits in the cells, formatted as text, etc. There are no filters in place to clear. Have copied and pasted into new workbooks, into and out of notepad, etc. 

This is driving me nuts and I need to use this sort feature on multiple sheets. Please help!

10 Replies
there appears to be something wrong with your attached file. Could you try it again please

@mathetes I'm not sure what is wrong with the file? Opens fine for me. I attached it again and also as .xls file.

@poholekc 

 

I'm not sure either. If you go back and look at the original, you'll see that its size is given as 1KB, a fraction of these most recent.

 

HOWEVER, even your most recent generate this error message when I try to download them.

mathetes_0-1607103776197.png

 

@mathetes Trying again...

@poholekc 

 

Whew... finally!

 

Is this in the order you wanted? I created two helper columns, taking apart the text at the space, creating a column on text only and a column of the numbers, sorting the latter as numbers, not as text.

 

@poholekc 

Total length on the list as SUM(LEN(range)) is about 2000 characters, includes invisible characters between items. Last items in your range are not in the list, you may check in dialogue box. Thus they are sorted wrongly. The workaround is to create helper column to the right of your list like 1,2,3,4,... and sort on it.

 

All details are here Custom List Limits - Excel Tips - MrExcel Publishing

@mathetes Thanks for the suggestion. Now I can't open your file, but that's ok. I understand your approach. It bugs me that this needs a workaround like you suggested though when it should work with the original formatting.

@poholekcThat original file somehow got corrupted , was only 1KB in size. Here's what should have been attached.

@Sergei Baklan This is genius. Thank you! Will choose shorter labels in the future to avoid the extra characters.

@poholekc 

Excel initially is more numbers calculator, working with texts we always shall take size limits into account.