Why does AAH sort AFTER FBH?
I have a column that contains hex numbers in the format xxH Where xx varies from 80 to FB. When I sort by this column, AAH always sorts last. Why?
iMac 27″ 5K, macOS 13.6
You can make a difference in the Apple Support Community!
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
I have a column that contains hex numbers in the format xxH Where xx varies from 80 to FB. When I sort by this column, AAH always sorts last. Why?
iMac 27″ 5K, macOS 13.6
I see if you add another language in the Language&Regions settings, the "List Sort Order" setting will appear in the Advanced settings. Svenska (Swedish) is one that makes it appear. But I haven't been able to get Numbers to sort that odd way and whatever is in your system settings should apply to all users while your problem seems to be just your user account. I did not try hard to get my computer into the same state as yours, though (for obvious reasons). This problem is a mystery to me.
I see if you add another language in the Language&Regions settings, the "List Sort Order" setting will appear in the Advanced settings. Svenska (Swedish) is one that makes it appear. But I haven't been able to get Numbers to sort that odd way and whatever is in your system settings should apply to all users while your problem seems to be just your user account. I did not try hard to get my computer into the same state as yours, though (for obvious reasons). This problem is a mystery to me.
Given that they have an "H" at the end, I am assuming these "numbers" are text, not formatted as numeral system base 16. Try re-entering that one.
If re-entering it didn't fix it,
I have not been able to duplicate your problem. Whether the values are formatted as "AAH" or as numeral system base 16 (without the "H"), they sort correctly and they sort the same way (for the range of numbers being used here).
If you use "words" in a column and sort them, do they sort wrong, too? How about AAA,AAH, AAI, AAJ, ABC,ABD, BAA, BBB, and "words" like that or Aaron, Aron, Baron, Carol, Don, and names like that?
I found this link with some discussion of the problem. I didn't read to the bottom to see if it solved it.
That gave me the hint I needed to fix it.
I added Svenska (Swedish) to the list of languages and then the sort order item appeared. I then selected Universal (It appeared to be set to an invalid value as no current value was displayed before I selected Universal). I then performed the sort and it sorted properly.
I then removed Swedish from the list of languages causing the sort order item to disappear, but the sort was still working properly.
I suspect that somehow/somewhere, the sort order got messed up and stayed messed up across upgrades/migrations. Then, simply changing languages didn't fix it. However when I got the choice to appear and set it back to universal that fixed things.
Thank you for helping me track this down and fix it..
OK, I completely quit numbers and relaunched. I then entered this list of words in a new document:
If I sort that ascending by column B (Column A not shown), I get:
Anything that has a double A in it appears to be sorting as it that put it at the end of the collating sequence. and the AAA sorted a the very end as if the third A made it even later.
Since you could not reproduce this, I think my next step will be to shut everything down and reboot and then retry and see if it is still handling. This almost looks like something in the collating sequence support got messed up.... I will post back after trying that.
Yes, they are formatted as text. I have re-entered that one several times to ensure that it is entered correctly and without any special "characters" embedded into it. I also re-entered several of the others that should have sorted either before or after with no changes. Yes, it sorts at the bottom when sorted ascending. When sorted descending, it sorts at the top. The numbers came from a document that I have only in scanned form, so I re-entered all of them manually.
As an FYI, the only reason I entered the training "H" on each of the numbers was to ensure that Numbers did NOT treat any of them as numbers as that would have messed up the sort.
Did a little more experimenting. Created another sheet and in Column A put the sequence AA, AB, ..., AZ, BA, BB, ... , BZ, ... JZ. In Column B, I put 00H, 01H, ... 09H, 0AH, ... 0FH, 10H, ... FFH. The last 4 rows of column B I left blank. If I sort this sheet by Column B Ascending, It moves the AAH entry to the end just before the rows with that cell blank. If I sort it Descending, AAH ends up at the top followed by the rest of the rows with entries in proper descending order followed by the blanks.
Now to get things more interesting, I sorted by Column A. If I sort ascending, the AA ends up in the last row with the rest in order as expected. If I sort descending, it exactly reverses it placing AA first and the rest in order as expected.
It appears the for some reason, it wants to collate "AA" as if it was a single character which is greater than "JZ". On a whim I checked the settings->general->Language & Region settings and they are English, United States, so the collating sequence ought to be UTF-8 and I would not expect it to be interpreting "AA" as anythings special....
OK, I rebooted. That did not fix the problem.
So, I logged into a different account on the same mac and opened the file in Numbers in that account.
It worked properly there.
For grins, I also did the same thing on my laptop and it also worked properly there.
Any idea of where I should look to figure out what is messed up in my primary account to cause this? I cannot even begin to guess where to look to track down a collating sequence problem. I was not even aware it was possible to cause this kind of mixup....
I wish I knew. It is strange. The only thing I find that sounds connected is the character pair Aa from Scandinavian languages. It is also written as Å which is ASCII code 197. That ascii code value comes after Z but it sorts directly after the regular A's for me.
That article seems to describe exactly what I am seeing....
I am running MacOS 13.6.9 and the setting described does not appear (at least for english, the help implies it might for some languages).
Just for grins, I tried changing the language to spanish and back to english (did not help) and then to norwegian (since that was what the example pointed out) and back to english (still no help).
It has been a long time since I did a slash and burn install, so it is possible that something got messed up in a previous version and got carried forward by migrations and upgrades.
Any idea where this is stored? Is there a plist I could edit to manually verify/change the sort order setting even though it is not appearing in settings? Or possibly a terminal command to examine/change it?
I do not remember ever changing this kind of language setting before, but it has been many years and I may simply not remember having done something to test and forgotten to change it back.
This definitely appears to describe what I am observing, so I suspect it is the problem. The question is simply how to fix it.
Does it do the same thing in a new/other or all documents?
My pleasure. I'm glad you got it worked out.
Why does AAH sort AFTER FBH?