SORT Function Google Sheets: Everything You Need to Know!

8 Minutes

The SORT function in Google Sheets is an extremely useful feature, it helps organise data making it easier to understand. In this article we will cover this feature in detail, the various methods to apply, and look at some examples that can help bring your data to new heights.

Google Sheets Sort Function Syntax

The syntax for the SORT function is as follows:

=SORT(Range, Column1, is_ascending, Column2, is_ascending2)

Syntax Breakdown:

=SORT: Here we are calling the feature used for sorting information

Range: This is where we reference our initial data range, this tells the program where to look in relation to our follow up logic

Column1: This will be the column specified to be sorted first, within the defined range the column reference will move from left to right starting at the number 1.

Is_ascending: This is inputted as either a TRUE or False value as follows:

TRUE-Data will be sorted in ascending order. This would also be referred to as A-Z

FALSE-Data will be sorted in descending order. This would also be referred to as Z-A

Column2, is_ascending2: These are optional and are only applied when sorting multiple columns

SORT Syntax Uses

Single Column in Ascending Order (A-Z)



Single Column in Descending Order (Z-A)


Multiple Columns

2 Columns:

=SORT(RANGE,Column1,is_ascending, Column2,is_ascending2)

3 Columns:

=SORT(RANGE,Column1,is_ascending, Column2,is_ascending2,Column2,is_ascending3

Sort Using a Different Tab


Google Sheets Sort Function  Examples

Example 1 - Basic A-Z using the SORT Function

To demonstrate the basic SORT function an example data set has been created, the data shows an unsorted list of staff names. By using this function we will order the names in ascending order. Click here to view the dataset and follow along.

Step 1 - Select an empty cell adjacent to the data

Please ensure there is enough space for the new list to populate

Step 2 - Enter the SORT function

In the empty cell enter the sort function formula:


Formula Breakdown:

=SORT: The SORT function 

RANGE: This is the data range, in our example this is B3:B22

Column: The column number, columns are numbered from left to right in the stated range. As there is one column we will enter the number 1

Is_ascending: This is the true or false value that decides the ascending order of the sorted results. As we need the results to be in an ascending order we need to input TRUE

Google Sheets sort - Basic A-Z sorting

Step 3 - Press enter to see results

The sorted list will be populated and displayed in an ascending order (A-Z).

Google Sheets sort - Basic sort using column number

Example 2 - Sort a data range using the SORT Function

Instead of applying The SORT function to a column of data by column number, we can apply this powerful function to a data range. This can be achieved by replacing the column number in our formula to a data range.

Step 1 - Select an empty cell next to the data

Please ensure there is enough space for the new list to populate

Step 2 - Input the SORT formula

We will now input the SORT formula:

=SORT(RANGE,Sort Cell Range,is_ascending)

See how we have replaced the column number from the previous example to a cell range instead, this will now order the data in the range of B3 to B22.

Google Sheets sort - Using a data range

Important Note: When comparing data ranges the row and column count must match the initial data range, if this count is different you will receive a “mismatch” error:

Sort function Google Sheets - Using a data range: Mismatch error

This can be corrected by changing the sort range row count to meet the initial range. In this example replacing B3:B12 with B3:B22 will resolve this error as the row count will match.

Step 3 - Press enter to see the results displayed

The results are now populated and the data range is sorted in an ascending order.

Google Sheets sort - Using a data range: Results

If you would like to learn how to sort by date in google sheets we have you covered!

Lido is a new spreadsheet built for automation. Trigger emails, slack messages, and more directly from a spreadsheet.