Sorting with numbers

2 posts / 0 new
Last post
Sorting with numbers

Hi, having trouble getting my numbers to sort properly. Specifically 1 through 10 will not sort in numerical order.  I have the cells listed as numbers - not general - and I am operating on a Mac.

I want them to sort like this:

1 - Green

2 - Blue

3 - White

11 - Black

12 - Pink 

20 - Orange

But they are sorting like this:

1 - Green

11 - Black

12 - Pink

2 - Blue

20 - Orange

3 - White

 

Check your values are numbers, not text

The way these are sorting, it looks like Excel is treating the values as text, not numbers, and so they are being sorted alphabetically. Formatting the cells as numbers wont make any difference to the contents of the cells.

Check the values to see if there is an apostrophe in front of each number. This is the method you use to tell Excel that you're entering text instead of a number or formula.  Remove the apostrophes if they are present (the quickest way is to select all the cells and find/replace the apostrophes with nothing - the find/replace will only affect the selected cells).

Alternatively, what happens if you retype the numbers? Try it with 1, 11 and 12 and see if that changes the way the list sorts.

Add new comment