Filter by oil, exclude cooking oil, and refine your data with precision.

When filtering data in spreadsheets, it’s essential to refine your searches to achieve accurate results.

3 min readMicrosoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

There's a quiet elegance in the moment a filter stops being a blunt instrument and becomes a precision tool. The user's question, how to exclude "cooking oil" while keeping "oil" in the petrol sense, isn't just a spreadsheet puzzle. It's a small, practical lesson in how we define relevance. You can't just search for a word and hope the context sorts itself out. You have to be deliberate about what you're *not* looking for, not just what you are. That's the difference between a list of results and a meaningful answer.

In practical terms, this means moving beyond the first instinct of a simple `FILTER` or `SEARCH` and embracing the logic of exclusion. The user is already using `ISNUMBER` and `REGEXTEST`, which is a solid start. But the real power comes from stacking conditions: include rows where "oil" appears, then explicitly subtract rows where "cooking" precedes it. In Google Sheets, that might look like `=FILTER(A:A, REGEXMATCH(A:A, "(?i)oil"), NOT(REGEXMATCH(A:A, "(?i)cooking")))`. In Excel, you'd use `ISNUMBER(SEARCH("oil", A1))` paired with `NOT(ISNUMBER(SEARCH("cooking", A1)))`. The pattern is the same: you're teaching the machine to understand nuance by giving it two rules instead of one. That's not overcomplicating things, that's respecting the data's context.

What this reveals is a broader truth about working with data: precision isn't about knowing more formulas. It's about knowing how to combine the ones you already have. The user isn't asking for a new feature or a magical AI trick. They're asking for a method to refine their thinking. And that's exactly the right instinct. Whether you're filtering customer lists for an oil industry report or cleaning up a product catalog, the skill is the same: define what you want, define what you don't, and let the tool do the heavy lifting once you've set the boundaries.

So the next time you're staring at a filter that returns too much, don't get frustrated. Get specific. Ask yourself what's sneaking in that shouldn't be there, and then build a rule that pushes it out. That's not extra work, that's the work. The user already knows this, which is why they asked the question in the first place. They're not looking for a shortcut. They're looking for a sharper edge. And once you learn to exclude the noise, you'll find that including the right signal becomes almost second nature.

From Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

I was using Filter/Search/Isnumber/Regextest combos to filter only the cells that has the word "oil" for example. However, what to do if I wanna exclude all the cells that has "cooking oil" from my results?

(To give the context, I want to filter the customers that worked in petrol/oil industry only, but filtering using "oil" will include customers who sell/make cooking oil).

Read the original at Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community