Can data be sorted by multiple columns in numbers version 3

Since upgrading Numbers to version 3 (now 3.0.1) I have been unable to sort data in spreadsheets using multiple columns. Anyone found a solution?


Regards


kurrajong60

Numbers-OTHER, OS X Mavericks (10.9)

Posted on Nov 23, 2013 2:47 PM

Reply
9 replies

Nov 23, 2013 4:52 PM in response to kurrajong60

Hi kurrajong60,


Multiple column sort is not yet built into the interface of Numbers 3 but Apple has announced in this support document that it will be reintroduced in upcoming versoions.


Meanwhile, there is an ugly but easy workaround,


Say you have columns A,B, and C and you want to sort first by A then within A by C then within that by B.


Add a column D in which you put the formula =A&C&B. Then sort by column D.


If one of your columns you need to sort has numbers let me know and I can give you a workaround on how to make those sort properly using this method.


SG

Nov 23, 2013 5:27 PM in response to kurrajong60

Hello


Given the primary sort key (column) is A, secondary sort key is B and tertiary sort key is C, you can sort the table firstly by C, then by B and finally by A, each in its own ascending or descending order. It will yield the same result as the sort by three keys (A, B, C) because proper spreadsheet programme is to perform stable sort (that is to preserve the original order of the elements which have the same key value).


Regards,

H

Nov 23, 2013 5:50 PM in response to kurrajong60

Here's a simple example. Say you want this sorted first by Region then by Name then by Amount.

User uploaded file


So if you set up a sort index column with a simple formula and all you have to do is this (two clicks):

User uploaded file



Giving you this:

User uploaded file


Of course you could do it as I think Hiroto is suggesting and manually sort first by column B, then sort by C, then sort by A.


But that's a lot of trouble and it's easy to confuse the order so you end up having to start over again.


SG

Nov 24, 2013 7:24 AM in response to SGIII

Note that there're serious limitations of sort by concatenated columns:


1) It won't let you sort by each key in different order. E.g., A in ascending, B in descending and C in ascending can not be achieved by concatenated key.


2) Concatenated key can give wrong sorting result depending upon the characteristics of data. E.g., in the first table in the screenshot below, sort by key = A&B or key = A&" "&B will yield wrong result while sort by key = A&CHAR(8232)&B yield correct result, where CHAR(8232) is U+2028 LINE SEPARATOR. The point is to use a field separator which a) is not present in data AND b) comes before any characters in data when sorted in ascending order. The second table demonstrates the failure case of key = A&CHAR(8232)&B, where requirement b) is not met because Numbers internally represent U+2028 as <sf:lnbr></sf:lnbr> and manually entered line break in cell as <sf:br></sf:br> and the latter comes before the former when sorted in ascending order.


User uploaded file


Meanwhile the series of individual sort by each key in reverse significance order will always yield the correct result regardless of the characteristics of data set.


Regards,

H

Nov 24, 2013 7:48 AM in response to Hiroto

Thanks, Hiroto, for the helpful explanations.


I like the tip on using a field separator not present in the data.


But the purpose of the simple workaround is just that: to serve as a simple, convenient workaround until Apple reintroduces multiple column sort.


The workaround is convenient to use in many (probably most) situations of everyday spreadsheet use. For columns with numbers, padding with leading "zeros" works in most situations and it's easy to do.


In situations where the workaround doesn't work, as in your examples, one can do the successive manual sorts by each column in reverse signficance order as you have described.


Let's hope Apple gets multi-column sort right when they reintroduce it.


Best,


SG

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Can data be sorted by multiple columns in numbers version 3

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