You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do you sort a row of numbers?

Super simple thing to do, but I can't see how. I have a row (not a column) and the first cell is a name. After that, a bunch of cells have numbers. I want to select all the cells with numbers and sort them in order from lowest to highest. Why is this not obvious, or am I just dim?

iMac, OS X El Capitan (10.11), 3.4 GHz, Fusion drive

Posted on Jun 10, 2016 12:20 PM

Reply
19 replies

Jul 1, 2016 7:33 PM in response to Cartoonguy

Fuzzy language, this English. 😕


This may be clearer: "the single column has to be in a table separate from the part of the table that you do not want to be included in the sort, but it (the single column table) can be in the same document; even on the same sheet."


Try this sequence. Times in parentheses are from the time stamp of each screen shot:

Original Table (7:09:25 PM)

User uploaded file

Cells C2=C16 copied, then pasted onto (a different part of) the sheet, away from the original table. (7:10:06 PM)

User uploaded file

Cells of Table 3.1 (the one column sorting table) selected, sorted ascending, then copied.

Cell C2 of original table selected, Edit > Paste and Match Style. (7:10:49)User uploaded file

Select and delete the sorting table (one click, press delete).


Total time: 84 seconds (including the time to setup and take the second and third screen shots—about 20-30 seconds).

Jul 1, 2016 8:42 PM in response to Cartoonguy

Hi 'Guy,


Going back to your original question:

"I have a row (not a column) and the first cell is a name. After that, a bunch of cells have numbers. I want to select all the cells with numbers and sort them in order from lowest to highest."


You also asked "Why is this not obvious?" The answer to that is that something that is missing is not often 'obvious.' What's missing is the ability to sort cells in a row.


You can, however, sort numeric values arranged in a row, using a formula.

The 'numbers' must be actual numbers, though, not things like 'model numbers', which are often mixed alpha-numeric strings of characters.


Heres a method for sorting the numbers in the case you describe:


If you do have "a row", do this:

  • click on a cell to activate the table.
  • move the mouse pointer to the row reference tab for the row containing the data to be sorted.
  • Click on the v that appears beside the reference tab and choose Add row below.

User uploaded file

In the new row, click on the cell below the first number, and enter the formula shown (adjusting the cell references to fit the row containing the data, and the number subtracted from COLUMN() to give a result of 1 in this cell).

User uploaded file

Click the checkmark to confirm the formula. Then Fill Right to the end of the data.

User uploaded file

  • With the filled cells still selected, Copy.
  • Click on the first 'number' cell of the original data, then go Edit > Paste Formula Results
    This step pastes the copied number, but not the formulas that created/ordered them, replacing the originally recorded data with the same data sorted fro small to large.
  • Delete the new row used for calculation (Reference tab.. v ..Delete Row)


If you have multiple rows, it will be quicker to use a new table on which to do the sort. The basic steps are the same:

Original table shown with cells containing data to be sorted in each row:

User uploaded file

  • Add a new plain table that matches the size if the area whose rows are to be sorted.
    (the one shown was made by copying the selection above, then clicking on an empty space in the Sheet and pasting.
    The data shown will be overwritten by the formula's results)
  • Enter the formula in the top left cell of the new table.
    =SMALL(Table 3::$F2:$L2,COLUMN())

User uploaded file

  • Note that this setup needs no adjustment of the value returned by COLUMN().
  • Click the checkmark to confirm the formula.
  • Fill the formula down to the bottom row of the new table; Fill right to the last column.
  • With the results still selected, Copy, then click on the top left cell of the original table.

User uploaded file

  • Go Edit > Paste Formula Results
  • Select the calculation table. Press Delete.
  • Done.


Regards,

Barry

User uploaded file

Jul 3, 2016 1:01 PM in response to Barry

Thank you Barry. Something is tripping me up and causing this not to work for me. When you say,

"Cells C2=C16 copied, then pasted onto (a different part of) the sheet, away from the original table."


No matter where I paste the numbers elsewhere on the sheet, it still causes other columns to re order. The key must be where I am pasting them, but I am pasting five columns east of the original table and it still does not work.

Jul 3, 2016 5:07 PM in response to Cartoonguy

Possibly a vocabulary mismatch.


In Numbers:

Spreadsheet means the whole document.

A Spreadsheet may contain one or more Sheets

A Sheet is a 'blank canvas' extending as far as necessary down and right from the top left corner of the workspace. In Numbers 3, Sheets are often referred to as Tabs, due the series of Tabs across the top of a Numbers 3 workspace showing the names of the sheets in the document.

Each Sheet may contain one or more Tables, (plus other objects including images or other graphics, text boxes and charts (graphs)). These objects are placed 'on' the sheet.

A Sheet is NOT a large grid of cells. It is, as noted above, a blank canvas on which objects (including Tables) can be placed.

A Table is a block of cells arranged in rows and columns. Each Table is independent of the others on the same sheet. Adding or removing rows or columns from one table does not change any other Table on the Sheet. Changing the row height of one or more rows in one table has no effect on rows in the other tables on the same sheet.


Regards,

Barry

How do you sort a row of numbers?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.