Home

Data sort

%3CLINGO-SUB%20id%3D%22lingo-sub-119406%22%20slang%3D%22en-US%22%3EData%20sort%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-119406%22%20slang%3D%22en-US%22%3EPlease%20help!%20I%20have%20a%20block%20of%20numerical%20data%20and%20I%20want%20excel%20to%20organize%20this%20from%20smallest%20number%20to%20largest%20and%20keep%20it%20in%20the%20table%20format.%3CBR%20%2F%3EThis%20is%20not%20a%20list%2C%20it's%20a%20block%20of%20numbers.%20I%20want%20them%20in%20order.%20I%20can't%20figure%20out%20how%20to%20sort%20it.%20Please%20help!%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-119406%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-383439%22%20slang%3D%22en-US%22%3ERe%3A%20Data%20sort%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-383439%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F89417%22%20target%3D%22_blank%22%3E%40Sandy%20Gomez%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EJust%20in%20case%20I%20have%20left%20you%20high%20and%20dry%3C%2FSPAN%3E%2C%20a%20way%20of%20creating%20the%20sequence%20'k'%20is%20first%20to%20define%20a%20dummy%20array%20reference%20in%20the%20top%20left%20hand%20corner%20of%20the%20sheet.%26nbsp%3B%20You%20are%20not%20interested%20in%20its%20content%20but%20it%20will%20allow%20you%20to%20use%20row%20and%20column%20numbers%20to%20generate%20the%20sequence%20'k'.%26nbsp%3B%20In%20name%20manager%2C%20add%20a%20new%20Name%20'dummy'%20and%20let%20it%20refer%20to%3C%2FP%3E%3CP%3E%3D%20OFFSET(%20Sheet1!%24A%241%2C%200%2C%200%2C%20ROWS(Array)%2C%20COLUMNS(Array)%20)%3C%2FP%3E%3CP%3EHaving%20done%20that%2C%20define%20a%20further%20name%20'k'%20to%20refer%20to%3C%2FP%3E%3CP%3E%3D%20(%20ROW(%20dummy%20)%20-%201%20)%20*%20COLUMNS(%20dummy%20)%20%2B%20COLUMN(%20dummy%20)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENow%20the%20formula%3C%2FP%3E%3CP%3E%3D%20SMALL(%20Array%2C%20k%20)%3C%2FP%3E%3CP%3Eshould%20return%20your%20array%20sorted%20across%20the%20row%20and%20then%20down%20to%20the%20column.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-383435%22%20slang%3D%22en-US%22%3ERe%3A%20Data%20sort%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-383435%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F89417%22%20target%3D%22_blank%22%3E%40Sandy%20Gomez%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EBuild%3C%2FSPAN%3Ean%20array%20'k'%20containing%20the%20number%20sequence%20from%201%20in%20the%20shape%20of%20the%20array%20you%20wish%20to%20output.%26nbsp%3B%20This%20could%20be%20a%20row%2C%20a%20column%2C%20a%202D%20array%20matching%20your%20array%20or%20even%20its%20transpose.%26nbsp%3B%3C%2FP%3E%3CP%3EUsing%20my%20version%20of%20Excel%2C%20that%20is%20easy.%26nbsp%3B%20I%20simply%20define%20the%20Name%20'k'%20to%20refer%20to%26nbsp%3B%3C%2FP%3E%3CP%3E%3D%20SEQUENCE(%20ROWS(Array)%2C%20COLUMNS(Array)%20)%20%26nbsp%3B%3C%2FP%3E%3CP%3E%5B2D%20array%20output%5D%3C%2FP%3E%3CP%3Eor%3C%2FP%3E%3CP%3E%3D%20SEQUENCE(%20ROWS(Array)%20*%20COLUMNS(Array)%20)%3C%2FP%3E%3CP%3E%5Bcolumn%20output%5D%3C%2FP%3E%3CP%3Eas%20appropriate.%26nbsp%3B%20You%20are%20likely%20to%20have%20it%20harder%20with%20ROW%20and%20COLUMN%20functions.%3C%2FP%3E%3CP%3EEither%20way%2C%20the%20formula%20you%20then%20require%20is%3C%2FP%3E%3CP%3E%3D%20SMALL(%20Array%2C%20k%20)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-383407%22%20slang%3D%22en-US%22%3ERe%3A%20Data%20sort%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-383407%22%20slang%3D%22en-US%22%3E%3CP%3EAn%20old%20query%2C%20never%20answered%2C%20I%20have%20the%20same%20problem%2C%20I%20have%20a%20block%20of%20numbers%2C%2011%20columns%20wide%20by%2022%20rows%2C%20no%20headers%2C%20just%20a%20big%20bock%20of%20numbers%20not%20yet%20in%20numerical%20order.%20There%20must%20be%20a%20way%20to%20sort%20this%20out%20into%20the%20correct%20order%2C%20I%20can%20do%20one%20column%20at%20a%20time%2C%20one%20row%20at%20a%20time%20but%20not%20the%20whole%20block.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyone%20have%20an%20answer%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Sandy Gomez
Occasional Visitor
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.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
22 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
13 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies