Today, we want to learn how wild­cards work with advanced filters. 

Advanced Fil­ters and wildcards

First of all, we have to remem­ber that an aster­isk replaces any text string, even an emp­ty one. A ques­tion mark replaces any sin­gle char­ac­ter. A tilde dis­ables a wildcard. 

Let’s start with find­ing ‘Red’ in the Prod­uct col­umn. To do that, we have to select one cell in our data, then go to the Data tab (1) and click on the Advanced fil­ter com­mand (2). In the Advanced fil­ter win­dow, we have to select the Copy to anoth­er loca­tion radio but­ton (3), then write the Cri­te­ria range (4). In the Copy to bar, we select our tar­get cell (5).

Advanced filter window
Fig. 1 Advanced fil­ter window

After press­ing OK, we have our results. In advanced fil­ters, we don’t have a sim­ple con­di­tion with text. This con­di­tion is not an equal con­di­tion, but a ‘starts with’ con­di­tion. In our tar­get col­umn, we have the ‘red’ word, how­ev­er, advanced fil­ters chose whole cells that start with ‘red’. If we want only the exact word, we have to write it with a sin­gle quote, then equals, then our word. Let’s write it. We should make anoth­er advanced fil­ter, so let’s make the same steps as in the pre­vi­ous exam­ple, start­ing with the Data tab and chang­ing the Cri­te­ria range to anoth­er col­umn (1) (Fig. 2)

Advanced filters with an exact word
Fig. 2 Advanced fil­ters with an exact word

In the tar­get cell, we can see only one cell with Drag­on­Fly, even though there are three cells with Drag­on­Fly in our data. 

Now, let’s try the aster­isk option. We write an aster­isk before ‘bee­tle’, but we have to remem­ber that it is always con­nect­ed with the ‘starts with’ option. We are work­ing with wild­cards as well as with the ‘starts with’ cri­te­ria. It works as if an aster­isk was also at the end of ‘bee­tle’. Let’s make a prop­er advanced fil­ter for this case star­ing with the Data tab and chang­ing the Cri­te­ria range into anoth­er col­umn (1) (Fig. 3)

 Advanced filters with an asterisk
Fig. 3 Advanced fil­ters with an asterisk

As we can see, ‘bee­tle’ can be at the end, at the begin­ning or even in the mid­dle of our cell.

Now, let’s work with ques­tion marks. We need to remem­ber that one ques­tion mark rep­re­sents only one sign. It can be a dig­it, a let­ter or any oth­er sign. For exam­ple ‘Ant ? — ? mm’ can­not rep­re­sent ‘Ant 6 — 10 mm’, because there are too many signs in 10. Let’s make an advanced fil­ter for that. We start with the Data tab, and we change the Cri­te­ria range (1) and the tar­get cell (2) (Fig. 4)

Advanced filters with an asterisk
Fig. 4 Advanced fil­ters with an asterisk

We can see that we found two cells where a ques­tion mark rep­re­sent­ed only one sign. 

Now, let’s move on to a tilde. We want to find the exact phrase of ‘*Ant’. That’s why we put a tilde at the begin­ning. If we put only an aster­isk and an Ant, like this ‘*Ant’, Excel would find any Ant, regard­less of its posi­tion. The tilde makes the aster­isk stop being a wild­card. We do the same as in pre­vi­ous cas­es, chang­ing only the Cri­te­ria range and the tar­get cell (Fig. 5)

 Advanced filters with a tilde
Fig. 5 Advanced fil­ters with a tilde

We can see that Excel found only one Ant with an aster­isk at the begin­ning. It’s because we turned off wildcards. 

https://www.youtube.com/watch?v=oRH3-S9v-8Q