Share via

How does Excel sort?

Anonymous
2015-01-29T21:49:24+00:00

I always thought that sorting deals with numeric characters first, then according to the ASCII code, but I think that notion was wrong.

If I have the following strings:

<5
>70
10-15
110+
15-23
24-70
5-9

Whether I do AtoZ or ZtoA sorting, the order is unchanged. I tried to prefix "space" looking characters CHAR(9), CHAR(10), CHAR(13), CHAR(28), CHAR(29), CHAR(30) in the hope that they could influence the sort order, but that failed. In fact just these characters alone,

I get ascending AtoZ:

=CHAR(8)
=CHAR(28)
=CHAR(29)
=CHAR(30)
=CHAR(31)
=CHAR(32)
=CHAR(9)
=CHAR(10)
=CHAR(13)
=CHAR(33)

and descending ZtoA

=CHAR(33)
=CHAR(13)
=CHAR(10)
=CHAR(9)
=CHAR(32)
=CHAR(31)
=CHAR(30)
=CHAR(29)
=CHAR(28)
=CHAR(8)

How does the sorting algorithm work exactly?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2015-01-30T17:56:33+00:00

    AFAIK..  the best place to get info on how the algorithm how sorting works is the TechNet forums. You may probably try checking over there. Meanwhile have a look at this: https://technet.microsoft.com/en-us/library/ee692895.aspx

    Was this answer helpful?

    0 comments No comments