Unexpected order for a range sorted using non-alphanumeric characters

I get an unexpected result when I sort the list with Excel or with some VBA ( Range.Sort). It seems that the hyphen is simply ignored when sorting the text:

List sorted by Excel

align-content
align-items
alignment-baseline    << Should be after "align-self"
align-self
animation-delay

Same list sorted with Libre Office

align-content
align-items
align-self
alignment-baseline
animation-delay

The documentation does not contain any information about this behavior:

https://support.office.com/en-gb/article/Sort-data-in-a-range-or-table-62d0b95d-2a90-4610-a6ae-2e545c4a4654?ui=en-US&rs=en-GB&ad= GB #__ toc246836970

https://msdn.microsoft.com/en-us/library/office/ff840646.aspx

So, is there any rule for this behavior?

Is it possible to sort the list in the same way as a person would do (as Libre Office does)?

+4
1

Excel , .

- " ", hyphen ( 45) dot ( 46).

=SUBSTITUTE(A1,"-",".")

- , :

hyphen space .

+4

Source: https://habr.com/ru/post/1657086/


All Articles