Sort

S

Starbright

I had a spreadsheet emailed to be. I would like to sort it, but there are
several rows that need to be sorted together as one row. For example in A1 I
have John Smith and in B1, B2, B3 I have dates. In A4 I have Jill Brown and
B4, B5,and B6 I have more dates. I need rows 1-3 to sort together and rows
4-6 to sort together. Right now when I sort the rows 1 and 4 sort and excel
puts row 2,3, 5, and 6 at the bottom. Can you help?
 
D

Dave Peterson

Excel doesn't like this kind of layout.

But you have a couple of options.

Insert a couple of new columns (say A and B) and use column A to contain the
unique identifier on each row of the group. Then in column B, you can use an
indicator (1, 2, 3, ...) that will be used as the secondary key. (So your data
can stay in order per group.)

The other option (that I can think of) is to "flatten" your data--only if you
have enough columns. Put row 2 of each group in the cells to the right of the
first row. Then row 3 moves to the right of that 2nd row's data.

Then sort your data (one record per entry).

You could even dump the sorted data into the same kind of 3 row format that you
started with.
 
G

Gord Dibben

Assuming A2 and A3 are blank, you could add the name to those cells.

Select column A and F5>Special>Blanks>OK

Type an = sign in active blank cell the point or arrow up to the cell above.

Hit CTRL + ENTER to add the names to blank cells.

Copy Column A and in place Edit>Paste Special>Values>OK>Esc


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top