2
I am trying to sort an Excel sheet based on a column that has a mix of:
- 3 digit numbers (such as 404)
- 3 digit numbers with non-numeric characters appended (such as 802b)
- non-numeric text (such as none or ?)
Excel sorts the plain numbers first, then the rest are sorted together, with the numbers+text in between punctuation marks and alpha characters.
I want the numbers and the numbers+text interleaved. But applying Format > Text to the column does nothing. How do I force it to sort numbers as text?
It seems that you don't understand alphabetical order. Indeed in alphabetical order, as in Secretarial folder filing system, numbers come first, then alpha numeric, and lastly alpha only. So, yes, Excel is doing this properly. – ejbytes – 2016-10-03T23:44:52.803
NOTE: However, if you treat Number+Text as First+Last name you will get what you desire. It follows: 2, 2 a, 3, 3 a. You will need to add a space between first group(numberic) and second group(alpha). – ejbytes – 2016-10-03T23:52:05.867
@ejbytes: that's the first I've ever heard of a particular "secretarial folder filing system" for alphabetical. Is there a way of sorting based on the
CODE()
result character-by-character without sorting on a derived column created by concatenating a bunch of 0-padded 3-digit ASCII values as text? I've got some hexadecimal numbers where 71AA should come before 7259, but due to the "Secretarial folder filing system" this does not occur. (yes, I know in my circumstance I could useHEX2DEC()
and then use a numeric sort, but that still requires an additional column & wouldn't work for non-hex) – mpag – 2018-04-03T19:46:30.197@mpag I'll not come back to this, but column as text 71AA will indeed sort above 7259. If you are looking for some other explanation I think this is the wrong place to look for it. Either create your own question if you are seeking solutions or move on to something more constructive. Anyhow, when would someone ever sort a hexadecimal filing system? One wouldn't. The question asked was nothing more than a 3-character sort problem. Answered. It worked out. Nothing more to see, these aren't the droids you're looking for. – ejbytes – 2018-04-04T08:39:33.150
@ejbytes "when would someone ever sort a hexadecimal filing system?" I dunno. If you had my job, you would have to sort hex numbers. Or rather, you wouldn't have to, but it would sure make the display of data in tables prettier. MS Docs at https://support.office.com/en-us/article/Sort-data-in-a-range-or-table-62d0b95d-2a90-4610-a6ae-2e545c4a4654 seem to suggest that formatting the cells as text is sufficient to have them sort as pure ASCII text, but 71AA was sorting below 7259. In seeking out an explanation, I came across this thread. Have a good day. Sorry for dragging you out of exile.
– mpag – 2018-04-04T18:16:33.627