How to Sort in Google Sheets

How to Sort in Google Sheets

Sorting data allows you to organize and analyze your data more effectively. You can sort in ascending or descending order, alphabetically, or by arranging numbers. Google Sheets also allows you to sort the dates in chronological order. There are five main ways to sort data in Google Sheets:

Method #1: Sort data using the Sort sheet option

This option sorts one column on your sheet but will change the other columns to correspond to the new order.

  1. Before sorting your data set, freeze the header row. You can do this by grabbing and dragging the thick grey horizontal bar at the top-left corner of the sheet.

    Freeze Header
    Click and drag the grey bar.

  2. Select any cell in the column you want to sort. In this example, we are sorting column B in ascending order.

    Select Cell
    Select a cell in the column you want to sort.

  3. From the “Data” menu, select Sort sheet. From the sub-menu, choose A to Z to sort the data in ascending order or choose Z to A to sort the data in descending order. This applies to both characters and numbers.

    Sort Sheet Options
    Select Data > Short sheet > A to Z or Z to A.

  4. The selected column has been sorted in ascending order. As you can see, Column A will also be sorted accordingly.

    Data Set Sorted By Short Sheet Option
    Columns in the sheet are sorted.

Method #2: Sort data using the Sort range option

This option will only affect the column you select.

  1. Select the column you want to sort. In this example, we are sorting column A.

    Select Range
    Select your column range.

  2. From the “Data” menu, select the Sort range option. From the sub-menu, choose A to Z to sort the data in ascending order or choose Z to A to sort the data in descending order.

    Sort Range Options
    Select Data > Short range > A to Z or Z to A.

  3. The selected range has been sorted in ascending order.

    Data Set Sorted By Short Range Option
    Selected range sorted in ascending order.

Method #3: Sort data using the context menu

This option allows you to sort data according to a specified range of column data.

  1. Select the range of column data you want to sort. We are sorting the entire column B in descending order in this example.

    Select Range
    Select your column range.

  2. Right-click on the data. Select View more cell actions > Sort range.

    Sort Range Option
    Right-click > View more cell actions > Sort range.

  3. When prompted with the Sort tool, choose A → Z for ascending sort or Z → A for descending sort. Check the Data has header row option if your data set has a header row. Then, click on the Sort button.

    Sort Tool
    Choose the order of sort.

  4. The selected range has been sorted in descending order.

    Data Sorted Through Context Menu
    Selected range sorted in descending order.

Method #4: Sort data using the column header

In Google Sheets, the column headers are named A, B, C, D, and so on. If you want to sort the entire column, you can use the column header’s sort feature. Follow these steps:

  1. Before sorting your data set, freeze the header row. You can do this by grabbing and dragging the grey horizontal bar at the top-left corner of the sheet.

    Freeze Header
    Click and drag the grey bar.

  2. Select the column you want to sort by clicking on the column header. In this example, we’re sorting column A.

    Select Column Header
    Select your column header.

  3. Right-click on the data. Then, choose the Sort sheet A to Z for ascending sort or Sort sheet Z to A for descending sort.
    Sort Sheet Option
    Right-click > Sort sheet A to Z or Sort sheet Z to A.

    Column A is now sorted in descending order. Column B remains unaffected.

    Data Set Sorted Through Column Header
    Column A sorted in descending order.

Method #5: Sort data using the SORT function

The SORT function allows you to sort the selected range of data by a specified column. It returns a new set of sorted data while the original remains intact. Like the Short sheet feature, the Sort function keeps the corresponding data across the row intact.

Syntax

=SORT(range, sort_column, is_ascending)

Arguments

  • range = the range of data where you want the sort to be applied.
  • sort_column = The index of the column in the selected range. It is the column that the data will be sorted by.
  • is_ascending = TRUE for ascending order or FALSE for descending order.

Example

  1. Select a cell where you want to return the sorted data. Then, start typing the below formula followed by an opening parenthesis:
    =SORT

    Sort Function
    Insert the SORT function.

  2. Select the range of data you want to sort, followed by a comma. In our example, select the range B2:B22.

    Select Range
    Select the range of columns.

  3. Next, enter the index of the column you want to sort, followed by a comma. In our example, we are sorting column 2 in ascending order.

    Index
    Insert the column index.

  4. Type FALSE for descending sort or TRUE for ascending sort.

    Order
    TRUE for ascending or FALSE for descending.

  5. Insert the closing parentheses and hit Enter. Your data will now be sorted.

    Data Set Sorted By Sort Function
    Selected range sorted in ascending order.

Phoebe is an HR assistant in her day job, but is also a web blogger that loves writing guides and sharing her experiences. When she is not out with her friends, she enjoys traveling or binge-watching Netflix. She graduated with a BA in Communication and Media Studies from the University of Utah, and is a chief editor at TechObservatory.

Leave a Comment