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.
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).
Click the checkmark to confirm the formula. Then Fill Right to the end of the data.
- 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:
- 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())
- 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.
- Go Edit > Paste Formula Results
- Select the calculation table. Press Delete.
- Done.
Regards,
Barry