• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Excel Custom AutoFilter with Wildcards

You are here: Home / Excel / Excel Custom AutoFilter with Wildcards
Excel AutoFilter
January 19, 2015 by Mynda Treacy

Excel’s Custom AutoFilter can perform a myriad of tasks that are often overlooked.

Just last week we had a question from Alf:

“I have a list of 7000+ words and want to search it with variables such as find all words where the third character is "u", or where the third character is "u" and the fifth character is "d".”

The solution is in Excel’s custom AutoFilter and using wildcards in the criteria.

Let’s look at an example. Here’s our data (it’s a little different to Alf’s):

Excel AutoFilter sample data

Let’s say I want to filter my list to display only SKU’s where the 2nd character is B and the 4th is 3. It’s easy with a custom AutoFilter.

Turn on Filters

First you need to turn on the AutoFilters. To do this:

Give your columns header labels (if you haven’t already) then you can either:

  1. Format your data in an Excel Table and the filter buttons will be inserted automatically. To do this select a cell in your data range > CTRL+T and make sure the ‘my table has headers’ box is checked:
  2.  
    format filter data in an Excel Table
  3. Or, select a cell in the header row > Data tab > Filter:
  4.  
    insert filter buttons

Now you should have the drop down arrows beside your column labels (circled in orange below) and you’re good to go:

filter buttons

Custom AutoFilter

To recap; I want to filter my list to display only SKU’s where the 2nd character is B and the 4th is the number 3.

Click on the drop down arrow in column A > Text Filters > Contains:

Text filters

In the dialog box enter ?B?3:

Custom AutoFilter dialog box

Now my list (see below) only displays the SKU’s that match my filter criteria:

Filtered List

[Edit]: Note, if there is a possibility that your data could have the filter criteria, in my case ?B?3, appear more than once in the text, then instead of 'Contains' use 'Begins with' ?B?3, or 'Equals' ?B?3*

AutoFilter Wildcards

There are three wildcards you can use with AutoFilter:

  1. ? The question mark (?) is a place holder for any character. Taking my example above I didn’t care what the first and third characters were, so by placing a ? in the filter criteria I was able to tell Excel to filter my list where the second and fourth characters met my criteria.
  2. * You can also use the asterisk (*) as a wildcard to represent a series of characters but this is the same as choosing Text Filters > Contains.
  3. ~ Lastly the tilde (~) allows you to search for wildcard characters. When you prefix a wildcard with the tilde you’re telling Excel that it should look for the character, not use it as a wild card. See example below: Here I want to search for SKU’s where the second character is a ?. So my custom AutoFilter criteria would is ?~?. The first ? is the placeholder and the ~? together tell Excel to look for SKU’s where the question mark is the second character:
  4.  

    Filtering with wildcards

Note:

Wildcards can only be used to filter text stings. They don’t work with numbers.

Thanks

I’d like to thank Catalin for reminding me of this feature in his reply to Alf who asked how it could be done.

Excel AutoFilter

More Excel Posts

linear regression

Excel Linear Regression

Excel linear regression is easy with the built-in tools. Use charts to plot linear regression or use the Data Analysis Toolpak.
speed up slow excel files

How to Improve Excel Performance

How to improve Excel performance and the various causes of slow Excel files so you can speed up Excel and avoid problems in future.
Securely Share Excel Files

Securely Share Excel Files

Securely share Excel files stored locally, on OneDrive or SharePoint. Prevent editing or downloading, specify who can open and edit the file.
excel check boxes

Interactive Excel Check Boxes

Excel check boxes are interactive elements you can link to formulas, charts, conditional formatting and more.
tips for working in multiple excel files

Hacks for Working in Multiple Excel Files

Awesome tips for navigating, arranging and working in multiple Excel files. Guaranteed to streamline your workflow and increase productivity.
chatgpt for excel

ChatGPT for Excel

Using ChatGPT for Excel can be hit and miss. Learn the best uses for ChatGPT to make your Excel life easier and what to avoid using it for.
excel templates

Where to Find Free Excel Templates

Where to find free Excel templates and how to create your own Excel templates. Using templates saves time and effort.
Easily Remove Password Protection from Excel Files

Easily Remove Excel Password Protection

How to remove Excel password protection when you’ve forgotten the password. Works for sheets, workbooks and read only files.
Import data from a picture to Excel

Import Data from a Picture to Excel

Import data from a picture to Excel. Works with pictures from a file or the clipboard and loads it to the spreadsheet.
excel online

5 Excel Online Features Better than Desktop

5 Excel Online Features Better than Desktop including searchable data validation, track changes, single line ribbon and more.


Category: Excel
Previous Post:Excel custom chart labelsExcel Custom Chart Labels
Next Post:Skip Dates in Excel Chart Axisset Excel axis to skip weekend dates

Reader Interactions

Comments

  1. Muhammad Ahmed

    May 4, 2017 at 7:21 am

    Mynda!
    Nice Tip 🙂
    Kindly provide custome filter workbook .

    Reply
    • Catalin Bombea

      May 4, 2017 at 2:18 pm

      Hi Muhammad,
      There is no workbook, you can do that with any data, the article is providing all the steps you need to apply a filter to your data set.
      Cheers,
      Catalin

      Reply
  2. Suchitra Gowda

    March 11, 2015 at 7:28 pm

    Dear Mynda,

    Its really interesting, Thank you, Please post some thing about pivot tables too.

    Reply
    • Mynda Treacy

      March 11, 2015 at 10:03 pm

      You’re welcome, Suchitra. Here is a link to our PivotTable tutorials:

      https://www.myonlinetraininghub.com/category/excel-pivottables

      Kind regards,

      Mynda

      Reply
  3. MF

    January 23, 2015 at 5:43 pm

    I think we may input the search string with ? or * directly into the “Search box” that is right below the “text filter”. 🙂

    Reply
    • Mynda Treacy

      January 23, 2015 at 7:38 pm

      Sometimes things are right in front of you and you still don’t see them! Thanks, MF. Great tip.

      Note: you have to enter ?B?3* in the search box as opposed to just ?B?3

      Cheers,

      Mynda

      Reply
      • MF

        January 24, 2015 at 3:27 pm

        Exactly! 🙂
        Another thing that is right in front of us and being ignored is:
        Clear Filter from xxx.
        Cheers,
        MF

        Reply
        • Mynda Treacy

          January 24, 2015 at 10:43 pm

          True. I like to have the clear filter icon in my QAT.

          Reply
  4. Jim

    January 20, 2015 at 9:44 pm

    I think you need to filter for ” Equals… ?B?3* ” or ” Begins With… ?B?3 ”
    filtering for ” Contains…” will also find that text in other positions in the text

    also, I use ctrl-L for creating a table, because it’s so similar to ctrl-shift-L for auto-filtering

    Reply
    • Mynda Treacy

      January 20, 2015 at 9:48 pm

      Good point, I guess if my data had more than 3 letters I’d need to consider more scenarios.

      I get an error with CTRL+SHIFT+L… must be missing something.

      Mynda

      Reply
      • Jim

        January 23, 2015 at 12:43 am

        can’t think why, ctrl-shift-L is even highlighted as a shortcut in your Option 2 above

        Reply
        • Mynda Treacy

          January 23, 2015 at 3:20 pm

          Ha, I have an add-in that uses that shortcut!

          Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Current ye@r *

Leave this field empty

Sidebar

More results...

Featured Content

  • 10 Common Excel Mistakes to Avoid
  • Top Excel Functions for Data Analysts
  • Secrets to Building Excel Dashboards in Less Than 15 Minutes
  • Pro Excel Formula Writing Tips
  • Hidden Excel Double-Click Shortcuts
  • Top 10 Intermediate Excel Functions
  • 5 Pro Excel Dashboard Design Tips
  • 5 Excel SUM Function Tricks
  • 239 Excel Keyboard Shortcuts

100 Excel Tips and Tricks eBook

Download Free Tips & Tricks

Subscribe to Our Newsletter

Receive weekly tutorials on Excel, Power Query, Power Pivot, Power BI and More.

We respect your email privacy

239 Excel Keyboard Shortcuts

Download Free PDF

mynda treacy microsoft mvpHi, I'm Mynda Treacy and I run MOTH with my husband, Phil. Through our blog, webinars, YouTube channel and courses we hope we can help you learn Excel, Power Pivot and DAX, Power Query, Power BI, and Excel Dashboards.

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk – For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.