The title isn't as clear as I'd like but it's the best I can think of.
I have data that I need to sort using multiple fields, and then, put keep in grouped pairs. There is an example below:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Group[/TD]
[TD]v1[/TD]
[TD]v2[/TD]
[TD]v3[/TD]
[TD]v4[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]4[/TD]
[TD]1[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]4[/TD]
[TD]1[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I need to sort the data for v1 - v4 in some combination of ASC/DESC. How doesn't matter, it will change. The trick is that, after I have it sorted, I then need to sort it such that the Group variable values are always next to each other. They do not need to be in ASC or DESC order, they just need to be next to each other. I cannot figure out how to sort like this in Excel.
I need something that essentially says
Sort1 = by v1 ASC, v2 DESC, v3 ASC, v4 ASC
Sort 2 = Sort1 by Group
I apologize if this is unclear. I think what I need to do is described, but I cannot for the life of me figure out how to do this.
And, I am not familiar with VBA, or macros. If that is the answer, they need to be explained step by step, or simply stated that they are the answer, b/c that's beyond my Excel chops. I could do that in SQL, SPSS, or R, though.
Thank you in advance for any contribution or help.
KS
I have data that I need to sort using multiple fields, and then, put keep in grouped pairs. There is an example below:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Group[/TD]
[TD]v1[/TD]
[TD]v2[/TD]
[TD]v3[/TD]
[TD]v4[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]4[/TD]
[TD]1[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]4[/TD]
[TD]1[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I need to sort the data for v1 - v4 in some combination of ASC/DESC. How doesn't matter, it will change. The trick is that, after I have it sorted, I then need to sort it such that the Group variable values are always next to each other. They do not need to be in ASC or DESC order, they just need to be next to each other. I cannot figure out how to sort like this in Excel.
I need something that essentially says
Sort1 = by v1 ASC, v2 DESC, v3 ASC, v4 ASC
Sort 2 = Sort1 by Group
I apologize if this is unclear. I think what I need to do is described, but I cannot for the life of me figure out how to do this.
And, I am not familiar with VBA, or macros. If that is the answer, they need to be explained step by step, or simply stated that they are the answer, b/c that's beyond my Excel chops. I could do that in SQL, SPSS, or R, though.
Thank you in advance for any contribution or help.
KS