How to Sort by Number in Excel & Google Sheets

In this tutorial, you will learn how to sort by number in Excel and Google Sheets.

 

sort by number initial data 1a

 

Sort by Number

Let’s use the following data to explain how to sort by number. In Column B, you have numbers that need to be sorted in ascending order.

 

sort by number initial data 1a

 

To do this using the Sort feature in Excel, select the column to sort, and in the Ribbon, go to Home > Sort & Filter > Sort Smallest to Largest.

 

sort numbers by sort option 1a

 

As a result, the numbers in Column B are sorted in ascending order.

 

sort numbers by sort option 2a

 

Filter Then Sort by Number

You can also sort numbers by first applying a filter to the column.

  1. Click on any cell in a column you want to sort and in the Ribbon, go to Home > Sort & Filter > Filter.

 

sort by number filter 1a

 

  1. Click on the filter button, which has appeared in cell B1, and choose Sort Smallest to Largest.

 

sort by number filter 2

 

The result is the same as using the Sort feature.

Possible Issues While Sorting

If any number in your list is stored as text (because of bad formatting, leading spaces, or something else), that value will not be sorted correctly. Say the value in cell B6 has a leading space and you sort by Column B.

 

number stored as text sort 1a

 

As you can see, this cell has a warning that the number is stored as text. Apart from this value, all other cells are sorted correctly.

To resolve this problem, (1) click on the warning icon next to the cell, and (2) choose Convert to Number.

 

number stored as text sort b

 

Now, if you sort the data again, the value is sorted with the others.

Sort by Number in Google Sheets

If you want to achieve the same thing in Google Sheets, select the range to sort (B2:B9) and in the Menu, go to Data > Sort range by column B, A → Z.

 

google sheets sort by number 1a

 

The result is the same as in Excel: Column B is sorted from the smallest value to the largest.

 

google sheets sort by number 2a

 

Column Options

You can also sort a column by using column options.

To do that, position the mouse on a column letter and click on the arrow when it appears next to the letter. Then click on Sort sheet A → Z.

 

google sheets sort by column option 1a

 

Again, as in the sections above, you get numbers in Column B sorted in ascending order.