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.
- 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.
- Select any cell in the column you want to sort. In this example, we are sorting column B in ascending order.
- 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.
- The selected column has been sorted in ascending order. As you can see, Column A will also be sorted accordingly.
Method #2: Sort data using the Sort range option
This option will only affect the column you select.
- Select the column you want to sort. In this example, we are sorting column A.
- 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.
- The selected range has been sorted in ascending order.
This option allows you to sort data according to a specified range of column data.
- Select the range of column data you want to sort. We are sorting the entire column B in descending order in this example.
- Right-click on the data. Select View more cell actions > Sort range.
- 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.
- The selected range has been 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:
- 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.
- Select the column you want to sort by clicking on the column header. In this example, we’re sorting column A.
- 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.
Column A is now sorted in descending order. Column B remains unaffected.
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
- Select a cell where you want to return the sorted data. Then, start typing the below formula followed by an opening parenthesis:
=SORT
- Select the range of data you want to sort, followed by a comma. In our example, select the range B2:B22.
- 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.
- Type FALSE for descending sort or TRUE for ascending sort.
- Insert the closing parentheses and hit Enter. Your data will now be sorted.