transcript

excelisfun - Advanced Filter: Filter Rows with List of Does NOT Contain Criteria - Excel Magic Trick 1594

Thumbnail of the video “excelisfun - Advanced Filter: Filter Rows with List of Does NOT Contain Criteria - Excel Magic Trick 1594”
Download Markdown
Community upload. AI output has not been independently verified.

In this video we're given a list of conditions and we need to filter this table and remove rows that contain any of these elements. Last video, 1593, we saw how to do this with Power Query, but if it's a one-time shot and you're not importing data, you might as well use Data and right here, Advanced Filter. Now, in order to use Advanced Filter, we have to set up the criteria area in a very specific way. Since we're looking through the Product Name column, we have to repeat that exactly. Then we use the NOT operator, and whatever we're looking for, we have to put asterisks on either side. That way it says not containing whatever that is.

Now, Control-C. I usually copy or make a formula to look over there, so I make sure that it's exactly the same number of characters. Right-click, Paste Values. We use the NOT operator, then we can't just do "not A," because then it would find exactly that. We use the wildcard asterisk. It stands for zero or more characters, so if we have it on either side, it'll find exactly "A" or anything else that contains "A."

Now we click in one cell, come up to Advanced Filter, and it got the range right. We want to copy it somewhere else, and here's the key: the criteria range, Product Name, listed twice, and the NOT Contains criteria below. Advanced Filter communicates from the criteria area over to the table area, so everything has to be spelled exactly the same. Now we want to copy all the columns, so I select one cell, and now when I click OK, I have extracted using NOT Contains.

If I change this to ABC, I could also insert another column and add a new criteria. Watch what happens when I come over here and we're not going to use the button, we're going to use the keyboard: Alt, A, Q. What it remembered: everything, because over in Name Manager, or the keyboard shortcut Control-F3, anytime you use Advanced Filter, it creates a defined name for criteria and for the extract range. I'm going to close this, Alt, A, Q, and because it memorized everything, we do have to select Copy to Another Location, but once we do that, everything's memorized. I can click OK, and now it has extracted using a different set of NOT Contains criteria.

And here's your bonus formula. You're not going to believe this if you haven't used Advanced Filter before. This formula, if I just used it in a helper column, would give me TRUEs and FALSEs all the way down. For this first row, notice it says TRUE, which means we need to keep it. But instead of using it in a helper column, Advanced Filter will, in memory, take it, copy it down, and then extract the rows. Watch this: Alt, A, Q. We have to change a few things. The criteria area is no longer there. It's there with an empty cell above the formula, and then the extract-to range. We're going to do this separately. When I click OK, we extracted the same data.

Now I have all sorts of videos on Advanced Filter. Here's one from my Highline Excel class that teaches you all the different uses for Advanced Filter, and if you want to see a crazy array formula for the example in this video, check out this one.