In this article we show you how to sort numbers in google sheets using the built in sort feature and by using the SORT function. The ability to order data is extremely useful in how data is understood, especially in larger sets of data.
The built-in feature in Google Sheets is very useful for quick sorting on smaller sets of data. Number data can be sorted in a couple of ways, either in an ascending order (A-Z: lower to higher) or a descending(Z-A: higher to lower)
For this example we have created an example dataset of staff members and their staff numbers. To demonstrate how to sort number data in an ascending order (A-Z). Will now order the data by staff number. Click here to view the dataset and follow along.
Drag to highlight the range of information in your dataset, in this example we need to ensure both names and numbers are highlighted otherwise the data will not remain together when sorted.
In the Sort range options in the data tab we can access the advanced sorting options for range.
Note: We can also access the advance range sorting options by right clicking our highlighted data and selecting View more cell actions > Sort range
A pop up window will appear with several options:
Data has header row: If your highlighted data includes a header remember to check this box
Sort by: This option will display the columns in your highlighted data, If you have checked the data header box the column information will change to your header information. Column C contains our number information but we have a header and checked the box, this now shows as “Staff Number”
A-Z or Z-A: The two radio buttons represent the order direction, as we want our data to be in ascending order we will select A-Z
Add another sort column: This option can be used to add additional columns to includet
Click on Sort and the information will be ordered as per your chosen parameters, in our example, the staff number data now appears in ascending order with the correct staff name next to it
In this example we will use our example dataset of staff members and their staff numbers. To demonstrate how to sort number data in an descending order (Z-A). Will now order the numerical data by using a filter.
Drag to highlight the range of information in your dataset
Once this is selected we will see the filter symbol appear at the top of our data:
For our example we need to select the filter symbol to the right of our Staff Number column, this will present the filter options:
In the options displayed we need to select Sort Z-A, once completed our data is arrange in a descending order with the largest number at the top and lowest at the bottom
The SORT function in Google Sheets allows a high level of precision within our data. You can read our full SORT tutorial below:
The syntax for the SORT function is written as:
=SORT(RANGE,Column,is_ascending)
Syntax Breakdown:
=SORT: We must first write this to declare the sort intention in Google Sheets
RANGE: The range of information that is to be included in the function
Column: This is the column number identifier for the data we wish to be ordered. Column IDs are arranged from left to right and start at 1
Is_ascending: This is either a TRUE or FALSE value and declares the order direction:
TRUE
Ascending order (A-Z)
FALSE
Descending order (Z-A)
Syntax Example:
=SORT(A1:B20,2,True)
This example would specify that the range of data is to include all cells from A1 to B20, column 2 (which would be Column B in this example) would be the column sorted and true declares the data will be ascending.
We will use the example dataset of Staff Name and Staff number, we will now use the SORT function in a formula to arrange the numerical data in an ascending order.
Ensure there is adequate room for the new list to populate
The formula for this example would be
=SORT(B3:C22,2,true)
This declares that the range of data is to include all cells from B3 to C22, column 2 (which would be Column C in this example) is the column to sort by and true declares the data will be ascending.
A new list is now populated with the numerical data arranged in an ascending (A-Z) order.
If you enjoyed this article, you might also like our article on how to sort on Google Sheets or our article on how to sort multiple columns in Google Sheets.
If you want to learn how to sort rows by color in Google Sheets or how to set up Google Sheets email validation, we also suggest checking out our detailed guide.