How do I sort a Numbers' table using data from another table?

So, I've got this data set coming from questionnaires. I created one table per question, questionnaires in rows, answers in columns, and everything is fine and dandy, but now I have this situation where the questionnaires pertain to a number of different groups. So I created a table associating the ID of the questionnaires with their group, and then I sorted it and I've got a nice aggregated view of questionnaires' IDs grouped together depending on their group.

Now I'd like to sort all my other tables' rows accordingly. Is this even possible? I know I should have done this before beginning to import the data…

EDIT Sample document at http://www.morpheu5.net/public/sample.zip

And (below image ) if you sort table "Condition" by column "c", you get a different sorting of the head column with the IDs.

This and the sorting I need to replicate on table "Q5.6…"

EDIT 2 I temporarily "solved" by copying column "c" from table "Condition" to all the other tables and used that to sort accordingly. I'm not marking this as my answer in case somebody comes up with a more efficient/correct way.

• Can you provide an example document?
– grg
Feb 11, 2014 at 16:10
• I figured it'd be useful so I was making one right after posting the question :) See the edited question, there's a link. Feb 11, 2014 at 16:14

Thanks to your sample file, I think I was able to do what you wished.

Using an additional column to bring in the numbers corresponding to the codes (16AA, 1; 16AE, 2...) sorting by that column then hiding it the desired result was accomplished. To refresh the sort after adding data, unhide the column and sort again.

Here are the steps:

• Create new column to the left of the "Code" column.

• Add a formula to extract the proper number for each code and copy down.

• Formula: `=INDEX (Group::c, MATCH (B, Group::A))`

(Using INDEX(MATCH) is a good way to get column data with out worrying about extra columns being added as is the case with VLOOKUP.)

• Copy the formula down, sort the column and hide it if desired.

Result:

• Nice one, thanks! I since restructured my data set and moved to CSVs and R/Julia, but this can come in handy again! :) Aug 8, 2015 at 8:27