Display only value that have things in common?

osscie3

Board Regular
Joined
Apr 30, 2014
Messages
70
This one is a hard one to articulate so I'll do my best. Also, please tell me if this is easier in Access.

I have a set of transactional data that has card number and merchant. I want to only display merchants (ideally in a pivot table) that all of those card numbers have been to and exclude the rest. For instance let's say I have 5 different card numbers and they've all made transactions at different merchants. I only want to see the merchants that ALL of those 5 cards have been to and exclude the rest. How can I do this?

Thanks!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Try to post a small sample along with the desired result(s) for that sample.

Card NumberMerchant
1Wal-Mart
1Target
1Lowes
1Home Depot
2Wal-Mart
2Panera Bread
2TGI Fridays
2CVS
3Wal-Mart
3Target
3Lowes
3Nordstrom
4Panera Bread
4Lowes
4Wal-Mart
4Home Depot
5Lowes
5Target
5Panera Bread
5Wal-Mart

<tbody>
</tbody>











I'd want it to return Wal-Mart since that's only merchant that all card numbers have in common.
 
Last edited:
Upvote 0

Book1
ABCDEF
1NumberMerchant
21Wal-MartWal-Mart
31Target
41Lowes
51Home Depot
62Wal-Mart
72Panera Bread
82TGI Fridays
92CVS
103Wal-Mart
113Target
123Lowes
133Nordstrom
144Panera Bread
154Lowes
164Wal-Mart
174Home Depot
185Lowes
195Target
205Panera Bread
215Wal-Mart
Sheet1


In E2 control+shift+enter, not just enter, and copy down:

=IFERROR(INDEX($B$2:$B$21,SMALL(IF(FREQUENCY(IF($B$2:$B$21<>"",MATCH($B$2:$B$21,$B$2:$B$21,0)),ROW($B$2:$B$21)-ROW($B$2)+1)=SUM(IF(FREQUENCY(A2:A21,A2:A21),1)),ROW($B$2:$B$21)-ROW($B$2)+1),ROWS($E$2:E2))),"")
 
Upvote 0
ABCDEF
1NumberMerchant
21Wal-MartWal-Mart
31Target
41Lowes
51Home Depot
62Wal-Mart
72Panera Bread
82TGI Fridays
92CVS
103Wal-Mart
113Target
123Lowes
133Nordstrom
144Panera Bread
154Lowes
164Wal-Mart
174Home Depot
185Lowes
195Target
205Panera Bread
215Wal-Mart

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

In E2 control+shift+enter, not just enter, and copy down:

=IFERROR(INDEX($B$2:$B$21,SMALL(IF(FREQUENCY(IF($B$2:$B$21<>"",MATCH($B$2:$B$21,$B$2:$B$21,0)),ROW($B$2:$B$21)-ROW($B$2)+1)=SUM(IF(FREQUENCY(A2:A21,A2:A21),1)),ROW($B$2:$B$21)-ROW($B$2)+1),ROWS($E$2:E2))),"")

Awesome. Will this work if there are multiple merchants in common?
 
Upvote 0

Forum statistics

Threads
1,215,327
Messages
6,124,290
Members
449,149
Latest member
mwdbActuary

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top