# 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

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.

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.

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

## 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.

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

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.

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.

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.

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

### 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.

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