Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

How is alphabetization determined in Excel and Google Sheets?

$
0
0

I was recently sorting data in Google Sheets that involved the word "hello" in various languages. An excerpt of this sheet is below. Column C was calculated using the =UNICODE(LEFT(B2,1)) function transposed down the C column. The top-left of the table is cell A1.

LanguageHelloUnicode Value of First Character
Englishhello104
ArmenianԲարեւՁեզ1,330
Amharicሰላም4,656
Bengaliহ্যালো2,489
Korean여보세요50,668
Japaneseこんにちは12,371
Chinese你好20,320

I then sorted the sheet from A to Z, using the Sort sheet by Column B (A to Z) menu option in the Data tab. However, the result was the table above. This wasn't what I was expecting, because the first character of cell B6 (여) has a Unicode hex value of U+C5EC, which is greater than the first character of cell B7 (こ, U+3053). Excel Online's attempt to sort the same table from A to Z was the following:

LanguageHelloUnicode Value of First Character
Englishhello104
ArmenianԲարեւՁեզ1,330
Japaneseこんにちは12,371
Bengaliহ্যালো2,489
Amharicሰላም4,656
Korean여보세요50,668
Chinese你好20,320

I previously believed that Google Sheets' and Excel's alphabetical ordering involved the Unicode codepoint of each character, but this appears to be incorrect. Here are other related notable findings:

  • Characters that look similar appear to be grouped together, such as both £ U+00A3 POUND SIGN and ¥ U+00A5 YEN SIGN coming before A U+0041 LATIN CAPITAL LETTER A.
  • Some CJK characters, like ㈮ U+322E PARENTHESIZED IDEOGRAPH METAL, are alphabetically before before almost every other character, including most Latin characters.
  • Many look-alike characters are alphabetically adjacent to their Basic Latin counterparts, like Å U+212B ANGSTROM SIGN and A U+0041 LATIN CAPITAL LETTER A both being before B, but not all look-alikes, such as Α U+0391 GREEK CAPITAL LETTER ALPHA coming after Z.

A link with all of these aforementioned Google Sheets tests is available here.

I personally can't find much reason to this ordering. How do Google Sheets and Excel alphabetize text?


Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>