How to Sort by Number in Excel & Google Sheets

Written by

Editorial Team

Reviewed by

Laura Tsitlidze

Last updated on October 29, 2023

This tutorial demonstrates how to sort by number in Excel and Google Sheets.

sort by number initial data 1a

Sort by Number

Say you have the data shown below, an unsorted list of numbers in Column B. Let’s use this example to show how to sort by number.

sort by number initial data 1a

To sort the numbers in ascending order, use the sort command 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

Now Column B is sorted, with the numbers 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 the column you want to sort. 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 command.

Possible Issues While Sorting

Excel’s sorting command works with both alphabetical and numerical data, but sometimes cell content can be misread and not accurately sorted. For example, 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, click on the warning icon next to the cell, and 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

Let’s use the example data from above to demonstrate sorting 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

As in Excel, this sorts Column B from the smallest value to the largest.

google sheets sort by number 2a

Column Options

Google Sheets has various column options. For this example specifically, column options in Google Sheets function like an Excel filter.

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.

AI Formula Generator

Try for Free

See all How-To Articles