top of page

You are learning Functions and Formulas in MS Excel

How do I use wildcards with asterisks (*) in formulas?

Wildcards, particularly asterisks (*), are powerful tools when working with formulas in Excel, allowing you to match a variety of text patterns. Here's how to use them:

Asterisk (*) Function:

The asterisk represents any number of characters within a text string.

* Placement: You can use the asterisk at the beginning, end, or even in the middle of your search criteria.

Examples:

* Find names starting with "S": `=COUNTIF(A1:A10, "S*")` - This counts cells in A1:A10 that begin with the letter "S" followed by any number of characters (e.g., Smith, Jones, Stewart).
* Find names ending with "er": `=SUMIF(B1:B20, "*er", C1:C20)` - This sums the values in C1:C20 for rows in B1:B20 where the cell content ends with "er" (e.g., Baker, Carpenter, Teller).
* Find names containing "an": `=VLOOKUP("*an*", D1:E10, 2, FALSE)` - This uses VLOOKUP to find the value in the second column (column E) of D1:E10 where the name in the first column (column D) contains the letters "an" anywhere in the text (e.g., Susan, Bran, January).

Important Notes:

* Asterisks are case-sensitive by default. If you want to perform a case-insensitive search, combine the wildcard with the UPPER or LOWER function in your formula.
* Be cautious when using wildcards, as they can lead to unexpected results if not used carefully. Ensure your search criteria are specific enough to avoid unintended matches.

Additional Wildcard Characters:

Excel also offers another wildcard character:

* Question mark (?) - Represents a single unknown character.

Remember: Wildcards are most commonly used with functions like COUNTIF, SUMIF, VLOOKUP, and filtering criteria. They can significantly improve the efficiency and flexibility of your Excel formulas when dealing with text data.

bottom of page