Sorting data across a range of cells allows us to organize our sheets better. Through it, we can navigate the arranged data more efficiently, finding the required information more quickly. In Google Sheets, users can quickly sort data in a range of cells using the SORT function.

With this function, we can sort data alphabetically in ascending and descending order or by specifying multiple criteria at once. In this article, we will show you how to sort data in a range of cells using the SORT function in Google Sheets.

Syntax of the SORT Function

Let's take a look at the syntax of the SORT function before moving on to implementing it on a dataset:

        =SORT(range, sort_column, is_ascending, [sort_column2, is_ascending2, ...])
    

Here, range refers to the cells containing the data you want to sort, and sort_column refers to the column by which you want to sort the data. With the is_ascending argument, you can specify the order in which you want the range sorted. As inputs, it accepts either TRUE or FALSE, where TRUE indicates ascending order, while FALSE indicates descending order.

Note: The SORT function generates output in different cells without affecting the original. Thus, instead of replacing existing data with sorted ranges, it sorts existing data in different sheets or cells based on your instructions.

How to Sort Data in Google Sheets Using the SORT Function

For clarity, let's sort the dataset shown below using the SORT function.

Dataset That We Will Sort in Google Sheets

Suppose our task is to sort the data by Column C (Wins) in ascending order. To achieve our desired outcome, follow these steps:

  1. Go to any cell that you wish to consider the first cell of the output range, which is F2 here.
  2. Type the following formula into the formula bar:
            =Sort(A2:D10,D2:D10,TRUE)
        
  3. Press Enter.
Sorting Data in Google Sheets Using Sort Function

As shown above, we have a specified range from cell A2 to D10, we are sorting the data by column D (D2 to D10), and we want to keep the sort ascending, so TRUE is used as the third argument. By pressing Enter, you will see the following output, the same as what we desired.

Final Output of Sorted Dataset in Google Sheets

How to Sort Data in Google Sheets Using the SORT Function With Multiple Columns

Google Sheets also allows us to sort the data by multiple columns, as shown in the syntax. When sorting data by multiple columns, the first column will be sorted first; then, the function will look for possible sorting options in the second column to avoid affecting the first sort.

To make the idea clear, let's apply it to the same dataset, as shown below:

Dataset That We Will Sort in Google Sheets

Let's suppose we want to sort data by Column B (Class), but we also want the student with more wins out of multiple students of the same class to appear first, i.e., sort Column C (Wins) in descending order. To get this output, the SORT function will look like this:

        =SORT(A2:D10,B2:B10,TRUE,C2:C10,False)
    
Sorting Data With Multiple Conditions in Google Sheets Using the Sort Function

The final output is as follows:

Final Output Showing the Sorted Data in Google Sheets With Multiple Conditions

As you can see, the data is sorted by Class in ascending order, but Column C is sorted in descending order according to the student with the most wins within a class. That's what our problem statement aimed for.

Similar to how we sorted the data by two columns or conditions, you can specify as many conditions as you want to make your sheets look professional, depending on how large your dataset is.

Lastly, do you think you are using Google Sheets to the fullest extent possible? You bet not! Many hidden features in Google Sheets can help you use it like a pro that you might be unaware of.

Use the SORT Function to Make Your Data Easy to Navigate

We have shown you how to sort your data in Google Sheets by a single column or multiple columns using the SORT function. This will help you visualize your data and make it easier to understand.

In addition to using the SORT function, you can also manually sort columns in Google Sheets. If you don't like using the SORT function, you can try manual methods.