Hi everyone,
I have an Excel 2007 Spreadsheet which takes a data-set and groups the results into column ranges:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD="align: center"]ID[/TD]
[TD="align: center"]1-9[/TD]
[TD="align: center"]10-19[/TD]
[TD="align: center"]20-29[/TD]
[TD="align: center"]30-39[/TD]
[TD="align: center"]40-49[/TD]
[TD="align: center"]50-59[/TD]
[/TR]
[TR]
[TD="align: center"]001[/TD]
[TD="align: center"]2, 8[/TD]
[TD="align: center"]13, 16[/TD]
[TD="align: center"]22, 29[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[/TR]
[TR]
[TD="align: center"]002[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]41, 44, 48[/TD]
[TD="align: center"]52, 56, 58[/TD]
[/TR]
[TR]
[TD="align: center"]003[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]11, 12[/TD]
[TD="align: center"]23, 26[/TD]
[TD="align: center"]33, 38[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[/TR]
[TR]
[TD="align: center"]004[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]24[/TD]
[TD="align: center"]34[/TD]
[TD="align: center"]45[/TD]
[TD="align: center"]58[/TD]
[/TR]
[TR]
[TD="align: center"]005[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]22[/TD]
[TD="align: center"]34[/TD]
[TD="align: center"]42, 38[/TD]
[TD="align: center"]N/A[/TD]
[/TR]
[TR]
[TD="align: center"]006[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]33, 36[/TD]
[TD="align: center"]42, 47[/TD]
[TD="align: center"]52, 57[/TD]
[/TR]
[TR]
[TD="align: center"]007[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]12, 15[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]51, 53, 56, 58[/TD]
[/TR]
[TR]
[TD="align: center"]008[/TD]
[TD="align: center"]1, 7[/TD]
[TD="align: center"]11, 13[/TD]
[TD="align: center"]23, 29[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[/TR]
[TR]
[TD="align: center"]009[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]27[/TD]
[TD="align: center"]33[/TD]
[TD="align: center"]47[/TD]
[TD="align: center"]59[/TD]
[/TR]
[TR]
[TD="align: center"]010[/TD]
[TD="align: center"]1, 3, 9[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]52, 53, 59[/TD]
[/TR]
</tbody>[/TABLE]
My question is - How do I take the row data and populate new tables based on how many groups of numbers appear in the row (excluding the ID column.) For example, the 2 group table would become:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD="align: center"]ID[/TD]
[TD="align: center"]1-9[/TD]
[TD="align: center"]10-19[/TD]
[TD="align: center"]20-29[/TD]
[TD="align: center"]30-39[/TD]
[TD="align: center"]40-49[/TD]
[TD="align: center"]50-59[/TD]
[/TR]
[TR]
[TD="align: center"]002[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]41, 44, 48[/TD]
[TD="align: center"]52, 56, 58[/TD]
[/TR]
[TR]
[TD="align: center"]007[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]12, 15[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]51, 53, 56, 58[/TD]
[/TR]
[TR]
[TD="align: center"]010[/TD]
[TD="align: center"]1, 3, 9[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]52, 53, 59[/TD]
[/TR]
</tbody>[/TABLE]
The 3 group table would become:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD="align: center"]ID[/TD]
[TD="align: center"]1-9[/TD]
[TD="align: center"]10-19[/TD]
[TD="align: center"]20-29[/TD]
[TD="align: center"]30-39[/TD]
[TD="align: center"]40-49[/TD]
[TD="align: center"]50-59[/TD]
[/TR]
[TR]
[TD="align: center"]001[/TD]
[TD="align: center"]2, 8[/TD]
[TD="align: center"]13, 16[/TD]
[TD="align: center"]22, 29[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[/TR]
[TR]
[TD="align: center"]003[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]11, 12[/TD]
[TD="align: center"]23, 26[/TD]
[TD="align: center"]33, 38[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[/TR]
[TR]
[TD="align: center"]006[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]33, 36[/TD]
[TD="align: center"]42, 47[/TD]
[TD="align: center"]52, 57[/TD]
[/TR]
</tbody>[/TABLE]
I wouldn't need the remainder of numbered groupings, so a solution for a 2 and 3 group would be perfect. My table which contains this data is not in the A column and is dynamically updated using a VBA macro.
Any help or pointers would be very much appreciated.
Thank you all in advance.
I have an Excel 2007 Spreadsheet which takes a data-set and groups the results into column ranges:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD="align: center"]ID[/TD]
[TD="align: center"]1-9[/TD]
[TD="align: center"]10-19[/TD]
[TD="align: center"]20-29[/TD]
[TD="align: center"]30-39[/TD]
[TD="align: center"]40-49[/TD]
[TD="align: center"]50-59[/TD]
[/TR]
[TR]
[TD="align: center"]001[/TD]
[TD="align: center"]2, 8[/TD]
[TD="align: center"]13, 16[/TD]
[TD="align: center"]22, 29[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[/TR]
[TR]
[TD="align: center"]002[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]41, 44, 48[/TD]
[TD="align: center"]52, 56, 58[/TD]
[/TR]
[TR]
[TD="align: center"]003[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]11, 12[/TD]
[TD="align: center"]23, 26[/TD]
[TD="align: center"]33, 38[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[/TR]
[TR]
[TD="align: center"]004[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]24[/TD]
[TD="align: center"]34[/TD]
[TD="align: center"]45[/TD]
[TD="align: center"]58[/TD]
[/TR]
[TR]
[TD="align: center"]005[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]22[/TD]
[TD="align: center"]34[/TD]
[TD="align: center"]42, 38[/TD]
[TD="align: center"]N/A[/TD]
[/TR]
[TR]
[TD="align: center"]006[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]33, 36[/TD]
[TD="align: center"]42, 47[/TD]
[TD="align: center"]52, 57[/TD]
[/TR]
[TR]
[TD="align: center"]007[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]12, 15[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]51, 53, 56, 58[/TD]
[/TR]
[TR]
[TD="align: center"]008[/TD]
[TD="align: center"]1, 7[/TD]
[TD="align: center"]11, 13[/TD]
[TD="align: center"]23, 29[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[/TR]
[TR]
[TD="align: center"]009[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]27[/TD]
[TD="align: center"]33[/TD]
[TD="align: center"]47[/TD]
[TD="align: center"]59[/TD]
[/TR]
[TR]
[TD="align: center"]010[/TD]
[TD="align: center"]1, 3, 9[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]52, 53, 59[/TD]
[/TR]
</tbody>[/TABLE]
My question is - How do I take the row data and populate new tables based on how many groups of numbers appear in the row (excluding the ID column.) For example, the 2 group table would become:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD="align: center"]ID[/TD]
[TD="align: center"]1-9[/TD]
[TD="align: center"]10-19[/TD]
[TD="align: center"]20-29[/TD]
[TD="align: center"]30-39[/TD]
[TD="align: center"]40-49[/TD]
[TD="align: center"]50-59[/TD]
[/TR]
[TR]
[TD="align: center"]002[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]41, 44, 48[/TD]
[TD="align: center"]52, 56, 58[/TD]
[/TR]
[TR]
[TD="align: center"]007[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]12, 15[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]51, 53, 56, 58[/TD]
[/TR]
[TR]
[TD="align: center"]010[/TD]
[TD="align: center"]1, 3, 9[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]52, 53, 59[/TD]
[/TR]
</tbody>[/TABLE]
The 3 group table would become:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD="align: center"]ID[/TD]
[TD="align: center"]1-9[/TD]
[TD="align: center"]10-19[/TD]
[TD="align: center"]20-29[/TD]
[TD="align: center"]30-39[/TD]
[TD="align: center"]40-49[/TD]
[TD="align: center"]50-59[/TD]
[/TR]
[TR]
[TD="align: center"]001[/TD]
[TD="align: center"]2, 8[/TD]
[TD="align: center"]13, 16[/TD]
[TD="align: center"]22, 29[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[/TR]
[TR]
[TD="align: center"]003[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]11, 12[/TD]
[TD="align: center"]23, 26[/TD]
[TD="align: center"]33, 38[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[/TR]
[TR]
[TD="align: center"]006[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]33, 36[/TD]
[TD="align: center"]42, 47[/TD]
[TD="align: center"]52, 57[/TD]
[/TR]
</tbody>[/TABLE]
I wouldn't need the remainder of numbered groupings, so a solution for a 2 and 3 group would be perfect. My table which contains this data is not in the A column and is dynamically updated using a VBA macro.
Any help or pointers would be very much appreciated.
Thank you all in advance.