Hello,
I am looking for some help to combine two tables of separate data based on a single column with a 1:M relationship. I do not have power pivot, so I am defaulting to vba as the best option (unless I hear otherwise).
Example:
The two tables share Group as a common Key - the macro should create a new table, joining both on group and extending to include both values. I do have other columns of data in each table, but they would be simple additions to the result and do not affect the join.
Table 1
<tbody>
</tbody>
Table 2
<tbody>
</tbody>
Expected result:
<tbody>
</tbody>
Thanks in advance!
I am looking for some help to combine two tables of separate data based on a single column with a 1:M relationship. I do not have power pivot, so I am defaulting to vba as the best option (unless I hear otherwise).
Example:
The two tables share Group as a common Key - the macro should create a new table, joining both on group and extending to include both values. I do have other columns of data in each table, but they would be simple additions to the result and do not affect the join.
Table 1
Account | Group |
50000 | Apple |
50000 | Plum |
50000 | Pear |
60000 | Apple |
60000 | Plum |
60000 | Pear |
<tbody>
</tbody>
Table 2
Group | Center |
Apple | 1000 |
Apple | 2000 |
Apple | 3000 |
Plum | 2000 |
Plum | 2500 |
Plum | 3000 |
Pear | 1000 |
Pear | 2500 |
Pear | 3000 |
<tbody>
</tbody>
Expected result:
Account | Group | Center |
50000 | Apple | 1000 |
50000 | Apple | 2000 |
50000 | Apple | 3000 |
50000 | Plum | 2000 |
50000 | Plum | 2500 |
50000 | Plum | 3000 |
50000 | Pear | 1000 |
50000 | Pear | 2500 |
50000 | Pear | 3000 |
60000 | Apple | 1000 |
60000 | Apple | 3000 |
60000 | Apple | 2000 |
60000 | Plum | 2000 |
60000 | Plum | 2500 |
60000 | Plum | 3000 |
60000 | Pear | 1000 |
60000 | Pear | 2500 |
60000 | Pear | 3000 |
<tbody>
</tbody>
Thanks in advance!
Last edited: