How to Sort Numerically in Google Sheets (3 Ways)

Today, we will look at the different ways to sort numerically in Google Sheets. We will be using both in-application options and functions to achieve our goal.

Let’s get started.


First Things First: Determine if the Value is a Number

When sorting by any value, it is important to make sure that the set of data that you are sorting is of the same type. Otherwise, this might happen:

wrong result for how to sort numerically in google sheets

Here, we have two types of data: text and numbers. Sorting the whole set in Google Sheets organizes the data according to their type. So it is best to check beforehand to make sure all the data in your selection is of the same type, in this case, numbers.

We can determine this in two ways:


I. Check Value Alignment

When data is input in a cell in Google Sheets, it aligns itself in the cell according to its type by default.

  • Left-aligned for text
  • Right-aligned for numbers

text and number alignment in a cell

Simply convert the text value to numbers before sorting.


II. Use ISNUMBER Function

Not all values in a worksheet will be aligned by default. Someone might have reorganized it. For such cases, we have a handy function available to us called ISNUMBER.

It simply determines whether the cell reference is a numerical value or not.

checking for numbers with the isnumber function

Later in this article, we will also see how to work with numbers as text values.


3 Ways to Sort Numerically in Google Sheets

1. Using Sort Range to Sort Numerically in Google Sheets

Let’s start with the simplest method, that is by using the Sort Range option of Google Sheets.

To use it, simply select the range of cells in the column you want to be sorted and navigate to the option. You can find the Sort Range options from the Data Tab > Sort Range

navigating to sort range from the data tab

Here, we will find two basic options:

  1. Sort by Column B (A-Z): Ascending Order
  2. Sort by Column B (Z-A): Descending Order

two sorting options in sort range

We have selected the first option. Our result:

using sort range to sort numerically in google sheets

An advanced options menu is also available for Sort Range where we can apply or add a couple more conditions to the sort.

To open this window, we have to navigate:

Data > Sort Range > Advanced range sorting options

navigating to advanced range sorting options

Advanced Range Sorting Options

Available Options:

  1. Data has header row: If your selection includes the header cell/row, make sure to check this option, otherwise, the header will also be included in the sorting. Another reason to check this option is to make sure your header appears as a selectable option for the Sort by section.
  2. Sort by: Here we select the column/header on which we will base our sort condition. We also select the ascending or descending order from here.
  3. Add another sort column: If your dataset contains more than one column (which is usual) you can add more column conditions by clicking on this button.

You can also access this window by right-clicking over your selection.

Right-Click > View more cell actions > Sort Range

navigating to sort range window by right-clicking

Read More: Sort By Column in Google Sheets (3 Easy Ways)


2. Using Filter to Sort Numerically in Google Sheets

While not a straight-up sorting method, the Filter option of Google Sheets can be used to sort columns in Google sheets.

The steps to us Filter to sort numerically in Google Sheets:

Step 1: Select the range of data. Make sure to select the column header. The header is the core of our filter. If you don’t have a header above your data, make sure to add one.

Step 2: Navigate to the Data tab to find the Create a filter option. Data > Create a filter

navigating to create a filter from the data tab

The header should now have a Filter icon beside it.

filter icon beside the column header

Step 3: Clicking on the Filter icon, you will be presented with a bunch of options. The ones we are looking for are the Sort options.

sort options in filter

Step 4: Click on the Sort option you want to get the result.

how to sort numerically in google sheets using the filter option


Similar Readings


3. Using Formulas to Sort Numerically in Google Sheets

Other than built-in options, we have the SORT function in Google Sheets to help us sort numerical data.

There are two advantages of using the SORT function:

  1. The sorted data is extracted to a different cell. It can be used to extract data from multiple locations, including another worksheet.
  2. Like advanced Sort Range, you can add multiple columns as sorting conditions.

The application is simple, you simply put the range of data within the SORT function, and the data will come out sorted in ascending order.

=SORT(B3:B12)

how to sort numerically in google sheets using sort function

However, if you want a descending order for your sort, you have to add the following conditions to the SORT function:

=SORT(B3:B12,1,FALSE)
  • The 1 represents the first column of our selection which will be the primary sorting column condition.
  • FALSE represents the sorting order. By default, it is TRUE (or 1) for ascending order. You can set it to FALSE (or 0) for descending order.

sorting numerically in descending order using the sort function

Read More: SORT Function for Multiple Columns in Google Sheets


A Workaround: Sorting Text Values as Numbers

At the beginning of this article, we had discussed that we can’t get a proper sorting result if we had different types of values in our selection, like numbers and text.

The simplest workaround to this is to use a function that takes a text value and converts it to its numerical counterpart. This function is called VALUE.

Now, if we put this function in our SORT formula, we can get the proper result:

=SORT(VALUE(B3:B12))

sorting numerically with text values using sort and value functions


Final Words

With that, we have formally covered how we can sort numerically in Google Sheets. We hope that the methods we have discussed come in handy in your daily tasks.

Feel free to leave any queries or advice you might have for us in the comments section below.


Related Articles for Reading

Mehrab Imtiaz

Mehrab Imtiaz

Mehrab Imtiaz is a Technical Writer for officewheel.com specializing in everything Google Sheets. Mehrab has always had a profound passion for writing and with his experience with MS Excel and Google Sheets throughout his career, it seems to be a great match when it comes to dishing out tips and tutorials for all to enjoy.

We will be happy to hear your thoughts

Leave a reply

OfficeWheel
Logo