FrostOnRoads
New Member
- Joined
- Nov 2, 2012
- Messages
- 2
Hey guys I've got an issue with data sorting. My data looks like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]A
[/TD]
[TD]B[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]2
[/TD]
[TD]aa
[/TD]
[TD]aa
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]12
[/TD]
[TD]bb
[/TD]
[TD]bb
[/TD]
[/TR]
[TR]
[TD]10
[/TD]
[TD]4
[/TD]
[TD]cc
[/TD]
[TD]cc
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]11
[/TD]
[TD]dd
[/TD]
[TD]dd
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]1
[/TD]
[TD]ee
[/TD]
[TD]ee
[/TD]
[/TR]
</tbody>[/TABLE]
I need it to look like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]1
[/TD]
[TD]ee
[/TD]
[TD]ee
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]2
[/TD]
[TD]aa
[/TD]
[TD]aa
[/TD]
[/TR]
[TR]
[TD]10
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]4
[/TD]
[TD]cc
[/TD]
[TD]cc
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]12
[/TD]
[TD]bb
[/TD]
[TD]bb
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]11
[/TD]
[TD]dd
[/TD]
[TD]dd
[/TD]
[/TR]
</tbody>[/TABLE]
Basically I need to resort B based on matches in A, leaving blanks where there are no matches. C and D are tied to B, and cells that exist in B but not in A should go to the bottom. I feel like there should be a way to do this without writing a macro. Columns A and B will be different lengths. I don't mind a two step process, though it's not preferable.
Any help is appreciated!
[TABLE="width: 500"]
<tbody>[TR]
[TD]A
[/TD]
[TD]B[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]2
[/TD]
[TD]aa
[/TD]
[TD]aa
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]12
[/TD]
[TD]bb
[/TD]
[TD]bb
[/TD]
[/TR]
[TR]
[TD]10
[/TD]
[TD]4
[/TD]
[TD]cc
[/TD]
[TD]cc
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]11
[/TD]
[TD]dd
[/TD]
[TD]dd
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]1
[/TD]
[TD]ee
[/TD]
[TD]ee
[/TD]
[/TR]
</tbody>[/TABLE]
I need it to look like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]1
[/TD]
[TD]ee
[/TD]
[TD]ee
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]2
[/TD]
[TD]aa
[/TD]
[TD]aa
[/TD]
[/TR]
[TR]
[TD]10
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]4
[/TD]
[TD]cc
[/TD]
[TD]cc
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]12
[/TD]
[TD]bb
[/TD]
[TD]bb
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]11
[/TD]
[TD]dd
[/TD]
[TD]dd
[/TD]
[/TR]
</tbody>[/TABLE]
Basically I need to resort B based on matches in A, leaving blanks where there are no matches. C and D are tied to B, and cells that exist in B but not in A should go to the bottom. I feel like there should be a way to do this without writing a macro. Columns A and B will be different lengths. I don't mind a two step process, though it's not preferable.
Any help is appreciated!