First, Thank you for this forum. I've followed it for a few years and everyone here has been very helpful. This is the first time I've not been able to find a solution to a problem.
I need to "invert" a table. I'd thought about doing it with some 2-d lookups, but most on here are numeric based and only work with a single instance within a table. Mine is a text only table, and too big to do by hand.
Say I have a table like below:
[TABLE="width: 397"]
<colgroup><col><col span="5"></colgroup><tbody>[TR]
[TD]a[/TD]
[TD]apples[/TD]
[TD]cranberries[/TD]
[TD]pears[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]b[/TD]
[TD]pears[/TD]
[TD]apples[/TD]
[TD]oranges[/TD]
[TD]lemons[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]c[/TD]
[TD]cranberries[/TD]
[TD]oranges[/TD]
[TD]lemons[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]d[/TD]
[TD]apples[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]e[/TD]
[TD]lemons[/TD]
[TD]pears[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]f[/TD]
[TD]apples[/TD]
[TD]lemons[/TD]
[TD]pears[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]g[/TD]
[TD]nuts[/TD]
[TD]apples[/TD]
[TD]oranges[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
What I need is the column 1 value beside each of the item types. If there are more than one, I need each of them in their own column:
[TABLE="width: 397"]
<colgroup><col><col span="5"></colgroup><tbody>[TR]
[TD]apples[/TD]
[TD]a[/TD]
[TD]b[/TD]
[TD]d[/TD]
[TD]f[/TD]
[TD]g[/TD]
[/TR]
[TR]
[TD]cranberries[/TD]
[TD]a[/TD]
[TD]c[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]pears[/TD]
[TD]a[/TD]
[TD]b[/TD]
[TD]e[/TD]
[TD]f[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]oranges[/TD]
[TD]b[/TD]
[TD]c[/TD]
[TD]g[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]lemons[/TD]
[TD]b[/TD]
[TD]c[/TD]
[TD]e[/TD]
[TD]f[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]nuts[/TD]
[TD]g[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I can do this in VBA or as macros/formulas; I really don't care. The real table is very large with about 21K items in the original table with about 3000 rows.
Any ideas would be greatly appreciated.
I need to "invert" a table. I'd thought about doing it with some 2-d lookups, but most on here are numeric based and only work with a single instance within a table. Mine is a text only table, and too big to do by hand.
Say I have a table like below:
[TABLE="width: 397"]
<colgroup><col><col span="5"></colgroup><tbody>[TR]
[TD]a[/TD]
[TD]apples[/TD]
[TD]cranberries[/TD]
[TD]pears[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]b[/TD]
[TD]pears[/TD]
[TD]apples[/TD]
[TD]oranges[/TD]
[TD]lemons[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]c[/TD]
[TD]cranberries[/TD]
[TD]oranges[/TD]
[TD]lemons[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]d[/TD]
[TD]apples[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]e[/TD]
[TD]lemons[/TD]
[TD]pears[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]f[/TD]
[TD]apples[/TD]
[TD]lemons[/TD]
[TD]pears[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]g[/TD]
[TD]nuts[/TD]
[TD]apples[/TD]
[TD]oranges[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
What I need is the column 1 value beside each of the item types. If there are more than one, I need each of them in their own column:
[TABLE="width: 397"]
<colgroup><col><col span="5"></colgroup><tbody>[TR]
[TD]apples[/TD]
[TD]a[/TD]
[TD]b[/TD]
[TD]d[/TD]
[TD]f[/TD]
[TD]g[/TD]
[/TR]
[TR]
[TD]cranberries[/TD]
[TD]a[/TD]
[TD]c[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]pears[/TD]
[TD]a[/TD]
[TD]b[/TD]
[TD]e[/TD]
[TD]f[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]oranges[/TD]
[TD]b[/TD]
[TD]c[/TD]
[TD]g[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]lemons[/TD]
[TD]b[/TD]
[TD]c[/TD]
[TD]e[/TD]
[TD]f[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]nuts[/TD]
[TD]g[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I can do this in VBA or as macros/formulas; I really don't care. The real table is very large with about 21K items in the original table with about 3000 rows.
Any ideas would be greatly appreciated.