Data sort

Copper Contributor
Please help! I have a block of numerical data and I want excel to organize this from smallest number to largest and keep it in the table format.
This is not a list, it's a block of numbers. I want them in order. I can't figure out how to sort it. Please help!
3 Replies

An old query, never answered, I have the same problem, I have a block of numbers, 11 columns wide by 22 rows, no headers, just a big bock of numbers not yet in numerical order. There must be a way to sort this out into the correct order, I can do one column at a time, one row at a time but not the whole block.

 

Anyone have an answer? 

@Sandy Gomez 

Build an array 'k' containing the number sequence from 1 in the shape of the array you wish to output.  This could be a row, a column, a 2D array matching your array or even its transpose. 

Using my version of Excel, that is easy.  I simply define the Name 'k' to refer to 

= SEQUENCE( ROWS(Array), COLUMNS(Array) )  

[2D array output]

or

= SEQUENCE( ROWS(Array) * COLUMNS(Array) )

[column output]

as appropriate.  You are likely to have it harder with ROW and COLUMN functions.

Either way, the formula you then require is

= SMALL( Array, k )

@Sandy Gomez 

Just in case I have left you high and dry, a way of creating the sequence 'k' is first to define a dummy array reference in the top left hand corner of the sheet.  You are not interested in its content but it will allow you to use row and column numbers to generate the sequence 'k'.  In name manager, add a new Name 'dummy' and let it refer to

= OFFSET( Sheet1!$A$1, 0, 0, ROWS(Array), COLUMNS(Array) )

Having done that, define a further name 'k' to refer to

= ( ROW( dummy ) - 1 ) * COLUMNS( dummy ) + COLUMN( dummy )

 

Now the formula

= SMALL( Array, k )

should return your array sorted across the row and then down to the column.