Hi All,
I have two tables, for both I have two options of presenting the data: (the data is just an example, the actual dataset is way bigger)
Table A1
Customer_ID | Purchased UPCs
43610023099 | 102
43610023099 | 5
43610023099 | 10
43610023090 | 102
43610023090 | 20
43610023090 | 15
Table A2
Customer_ID | Purchased UPCs
43610023099 | 102, 5, 10
43610023090 | 102, 20, 15
Table B1
Coupon_ID | Connected UPCs
Coupon_1 | 102
Coupon_1 | 3
Coupon_2 | 20
Coupon_2 | 11
Table B2
Coupon_ID | Connected UPCs
Coupon_1 | 102, 3
Coupon_2 | 20, 11
What I am trying to do is basically the following:
If any UPC of a customer matches any UPC of a Coupon, return that Coupon.
So I just want to show that they are connected through the UPC.
The result could be anything from:
Customer_1 | Coupon_1
Customer_1 | Coupon_3
Customer_2 | Coupon_2
or
Customer_1 | Coupon_1, Coupon_3
Customer_2 | Coupon_2
or
Coupon_1 | Customer_1
Coupon_2 | Customer_2
Coupon_3 | Customer_1
I am willing to do Macros in order to achieve this. And I thought about using a Match function with IF and eventually Arrays? But I am really struggeling to make something up that works.
PLEASE HELP!
Bookmarks