askvity

What Order Does Excel Sort In?

Published in Excel Sort Order 3 mins read

By default, Excel sorts data by row and presumes ascending order where a specific order is not provided.

Default Sorting Orientation: By Row

When you sort data in Excel, the primary method is to rearrange the rows based on the values in one or more columns. As stated in the reference, by default Excel will sort by row. This is the most common type of sort, used for organizing lists, tables, and datasets where each row represents a record.

  • Sorting by Row: Excel shifts entire rows up or down based on the criteria you set for a specific column (or multiple columns). For example, sorting a list of customers by their 'Last Name' column will move all the data for each customer (their entire row) to the correct position based on alphabetical order.
  • Sorting by Column: Sorting by column is less common and involves rearranging columns based on values in a specified row. This is typically selected intentionally, for instance, by choosing 'Sort Left to Right' in the Sort dialog box or using a function like SORT with the by_col argument set to TRUE. The reference highlights this: "and will only sort by column where by_col is TRUE".

Default Sorting Order: Ascending

When you initiate a sort without explicitly choosing ascending or descending, Excel will use the default order. According to the reference, "Where order is not provided, ascending order will be presumed."

  • Ascending Order: This means data is sorted from smallest to largest.
    • Numbers: 1, 2, 3, ...
    • Text: A, B, C, ... (alphabetical)
    • Dates/Times: Earliest to latest
  • Descending Order: This is the opposite of ascending, sorting data from largest to smallest (Z to A, highest number to lowest, latest date to earliest). You must specify this order when sorting.

Key Defaults and How to Control Sorting

Understanding the defaults is important, but Excel provides full control over how you sort your data.

Feature Default Behavior How to Change
Orientation Sort by Row Choose 'Sort Left to Right' or set by_col to TRUE
Ascending/Descending Ascending Order (if not specified) Choose 'Descending' (Z to A, Largest to Smallest)
Sort Key Based on selected column(s) or row(s) Specify the column(s) or row(s) to sort by
Multiple Levels Sorts by the first key, then the second, etc. Add multiple sort levels in the Sort dialog

You can customize sorting using:

  • The "Sort" dialog box (found under the Data tab).
  • The "A-Z" / "Z-A" quick sort buttons.
  • Sorting features within Excel Tables.
  • Excel functions like SORT.

By default, Excel sorts by row in ascending order, but you have the flexibility to change both the orientation and the order based on your specific data arrangement needs.

Related Articles