Match whole word in autofilter

wisekat

New Member
Joined
Feb 24, 2017
Messages
9
Is there a way to use the built-in Excel autofilter functionality to filter by exact words (the "whole word" option available in many text find dialogs)? For instance, I need to show only rows containing various combinations of the words "car" and "replace', but not "car" and "replacement". How to do that in Excel?

It would be nice if we could avoid creating special new columns or VBA coding.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
The column I want to filter contains various mixes of the words "car" and "replace" together with other words. Some examples: "used car replacement", "replace old car", etc.
 
Upvote 0
I woke up this morning with the thought of this question on my mind! This is simple I thought, add an extra column with a formula like =" "&A2&" "
Then filter on this new field for equals " car " or " replace ". Each with leading & trailing spaces. However it didn't work. The leading or trailing spaces are ignored when Excel does the filtering. So Excel doesn't apply the filter strictly. The spaces have some special treatment...

Then I changed to another character. I chose $. And this seems to work. So a formula in a new field ="$"&substitute(a2," ","$")
Now filter for $car$ or $replace$

if the $ isn't best for you, change to another character (other than space)

OK?

PS. I re-read your question & see you wanted to avoid adding special columns. So, I guess that means my suggestion is not the answer you're looking for: and maybe is already known. So, I'm still not much help on this. cheers
 
Last edited:
Upvote 0
Fazza, thank you for your idea. It works like a charm. I don't mind creating a special column for filtering like mine, though this way looks less natural.

The only correction to your answer from my side is the following. The formula template for the top cell in this special column should be

="$" & SUBSTITUTE(A2;" ";"$") & "$"
 
Upvote 0

Forum statistics

Threads
1,223,104
Messages
6,170,124
Members
452,303
Latest member
c4cstore

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