Excel: How to treat multiple lines as one while sorting?

Posted by crono on Super User See other posts from Super User or by crono
Published on 2012-07-02T12:29:12Z Indexed on 2012/07/02 15:18 UTC
Read the original article Hit count: 200

Filed under:
|

I get a XLS-File as a database report. The File is in the following format:

   | Customer | Name | ... | Orders
 1 |     6    | ...  | ... | 1234
 2 |          |      |     | 4567
 3 |          |      |     | 8910
 4 |     3    | ...  | ... | 3210
 5 |          |      |     | 8765
 6 |     1    | ...  | ... | 1000
 7 |          |      |     | 1001

I need to sort this thing on a column which is only "filled" in the first line of a "record" (here: Line 1-3, 4+5, 6+7) like "Customer" in this example. Is there a way (without falling back to VBA) to keep the lines together which form a "record" while sorting on them. I know, this is abusing Excel but I have no other choise here.

The expected output after sorting on "Customer" would be:

   | Customer | Name | ... | Orders
 1 |     1    | ...  | ... | 1000
 2 |          |      |     | 1001
 3 |     3    | ...  | ... | 3210
 4 |          |      |     | 8765
 5 |     6    | ...  | ... | 1234
 6 |          |      |     | 4567
 7 |          |      |     | 8910

© Super User or respective owner

Related posts about microsoft-excel

Related posts about sorting