How can I sort my data while keeping paired rows together?

How can I pair two rows on a spreadsheet, so that for each data entry I can sort the matrix but the pair of rows moves as a single list of data, retaining the structure of the two rows?

For example: Original entry

A1,1 B1,1 C1,1 D1,1
A1,2 B1,2 C1,2 D1,2
A2,1 B2,1 C2,1 D2,1
A2,2 B2,2 C2,2 D2,2

Sorted reverse order

A2,1 B2,1 C2,1 D2,1
A2,2 B2,2 C2,2 D2,2
A1,1 B1,1 C1,1 D1,1
A1,2 B1,2 C1,2 D1,2 
3

5 Answers

Set up a helper column to preserve the 2-row structure and sort this new helper column instead.

enter image description here

The helper column (E in my example) references to the same column you want to filter for (e.g column C) but with one small improvement: Every second row your reference jumps one row above

You can speed up things by entering only two formulas, select both cells and drag them with auto-fill down.

enter image description here

1

Store your data in one row per logical record:

                                data in single rows

You will, of course, be able to sort this normally.  Then set up a matrix with two rows per record on another sheet (or, possibly, on the same sheet) that references the data in the first matrix:

                        referencing the first matrix

That will display the way you want:

                                                        how the (paired row) data are displayed

Admittedly, this approach does not allow you to edit the data in the two-row format.

2

I've been having the same issue .... this is how I fixed it. Highlight/select all of the columns you have data entered in (or that you want included in the sort). Select data and select auto filter. This will place double arrows in the top row that will allow you to sort each column while keeping corresponding data in the same row. Hope this helps.

1

Are you asking for a step by step break down to do this or do you want a way to automate this?

The step by step for your example:

  • Select the first 4 rows then click Data and click Z -> A.
  • Then select just the top 2 and click A -> Z
  • Then select the bottom 2 and click A -> Z.
5

Turn your data into a table (highlight all the data, then go to "Insert" and click on Table). Once you have a table, you can sort on any column you want and the rows will always be "linked" so that they stay together when they move in the sort.

0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like