Need help with filtering and using that data to search

gueva

New Member
Joined
Jul 31, 2017
Messages
1
I'm quite newish to excel but here goes. Below is an example of the data I'm working with:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Location[/TD]
[TD]ID[/TD]
[TD]Units[/TD]
[/TR]
[TR]
[TD]A1-01-01[/TD]
[TD]2356487[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]A1-01-02[/TD]
[TD]2356487[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]A1-01-03[/TD]
[TD]7656732[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]B1-01-01[/TD]
[TD]7656732[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]B1-01-02[/TD]
[TD]2356487[/TD]
[TD]10[/TD]
[/TR]
</tbody>[/TABLE]


The B1 locations hold IDs which already exist in A1 locations. They are replenishment for when A1 stock gets low.
I'm working with thousands of locations which are updated frequently so it's difficult to keep up with the data manually.

Ideally, I would like an end result that looks something like this.
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Locations[/TD]
[TD]Units[/TD]
[/TR]
[TR]
[TD]2356487[/TD]
[TD]A1-01-01[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A1-01-02[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]B1-01-02[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]7656732[/TD]
[TD]A1-01-03[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]B1-01-01[/TD]
[TD]10[/TD]
[/TR]
</tbody>[/TABLE]

I only want the table to contain IDs that exist in both A1 and B1 locations. I'm guessing I'd have to use a pivot table in some way. But I don't how to only grab the ID's that exist in B1 and then use that output to also show which A1 locations they exist in.

Could anyone point me in the right direction?

Thanks a bunch!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I'm quite newish to excel but here goes. Below is an example of the data I'm working with:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Location[/TD]
[TD]ID[/TD]
[TD]Units[/TD]
[/TR]
[TR]
[TD]A1-01-01[/TD]
[TD]2356487[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]A1-01-02[/TD]
[TD]2356487[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]A1-01-03[/TD]
[TD]7656732[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]B1-01-01[/TD]
[TD]7656732[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]B1-01-02[/TD]
[TD]2356487[/TD]
[TD]10[/TD]
[/TR]
</tbody>[/TABLE]


The B1 locations hold IDs which already exist in A1 locations. They are replenishment for when A1 stock gets low.
I'm working with thousands of locations which are updated frequently so it's difficult to keep up with the data manually.

Ideally, I would like an end result that looks something like this.
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Locations[/TD]
[TD]Units[/TD]
[/TR]
[TR]
[TD]2356487[/TD]
[TD]A1-01-01[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A1-01-02[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]B1-01-02[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]7656732[/TD]
[TD]A1-01-03[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]B1-01-01[/TD]
[TD]10[/TD]
[/TR]
</tbody>[/TABLE]

I only want the table to contain IDs that exist in both A1 and B1 locations. I'm guessing I'd have to use a pivot table in some way. But I don't how to only grab the ID's that exist in B1 and then use that output to also show which A1 locations they exist in.

Could anyone point me in the right direction?

Thanks a bunch!

say your raw data is in Sheet1 columns A:C,

D2 = LEFT($A2,2)
E2 = AND(COUNTIFS($B$2:$B$6,$B2,$D$2:$D$6,"A1")>0,COUNTIFS($B$2:$B$6,$B2,$D$2:$D$6,"B1")>0)

create a pivot table and drag column into the filter section and select TRUE
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,259
Members
452,626
Latest member
huntinghunter

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