Dynamic filter based upon custom range in a separate column

virtuosok

Board Regular
Joined
Sep 2, 2020
Messages
209
Office Version
  1. 365
Platform
  1. Windows
Hi,
I have data in the following format (about 40 thousand rows, let's say this is tab Source):
1643575559744.png

I am interested in only a specific subset of subjects, and their IDs are listed in column I; rest of data should be hidden or deleted. I would normally just filter out what I need, but I have 3 limiting factors:
1. The list of subjects I am interested in ("reference list"), is almost 300 entries long.
2. Numbers in the reference list are non-contiguous and can fall anywhere between 1 and 7000
3. I cannot exclude possibility that the reference list turns out to be dynamic, e.g. individual IDs within that list may change with time, so I would need a new output whenever there's an update to the reference list.

The reference list is noted on a separate tab (let's say, tab List, cells A2:A300)
How can I quickly post-process source data to filter out, or isolate, only rows which belong to this specific list of subject IDs? I would then do pivot table for my further needs, being sure that I only look into a specific subset. Ideally I need a formula (along the lines of "check cell I2 against unique patient ID list on tab List, and if there's a match, copy row 2 in full onto tab Output; otherwise skip and check next row; stop after all rows are analyzed and copied over as appropriate"). Macro might also work though preference is a formula.
Hope I was able to explain my struggle...
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
How about
Excel Formula:
=FILTER(Source!A2:I50000,ISNUMBER(MATCH(Source!I2:I50000,Lists!A2:A300,0)))
 
Upvote 0
Solution
Amazing, thank you! This is working well and is a very elegant solution :)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,031
Members
448,940
Latest member
mdusw

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