Yes, Excel has a LIKE function, but it is not available as a worksheet function you type directly into a cell. The LIKE operator exists in two places: in Microsoft Query (used for external data connections) and in VBA (Visual Basic for Applications) code. For everyday worksheet use, Excel uses wildcards with functions like COUNTIF, SUMIF, and VLOOKUP to achieve the same pattern-matching effect that LIKE provides in SQL or Access.

Where the LIKE Function Actually Lives

If you have used SQL, you know LIKE is a standard operator for pattern matching. Excel borrowed this idea but implemented it differently depending on the context:

  • VBA: The Like operator in VBA works almost exactly like SQL's LIKE. You can write If cell.Value Like "A*" Then to test if a cell starts with “A”. This is fully functional but requires opening the Visual Basic Editor (Alt+F11) and writing a macro.
  • Microsoft Query: When you import external data through Data > Get Data > From Other Sources > From Microsoft Query, you can write SQL statements that include WHERE field LIKE 'A%'. This works but is a separate tool, not a native worksheet function.
  • Power Query: Power Query (Get & Transform) does not have a LIKE function either. It uses Text.StartsWith, Text.Contains, and Text.EndsWith instead, which are more explicit.

So if you searched “Excel LIKE function” expecting to type =LIKE(A1,"A*") into a cell, that function does not exist. What you need is one of the wildcard-capable functions described below.

How Wildcards Work in Excel Formulas

Excel supports three wildcard characters in formulas that accept them:

  • * (asterisk) – matches any number of characters. For example, "A*" matches any text starting with A.
  • ? (question mark) – matches exactly one character. "B?t" matches “Bat”, “Bet”, “Bit”, but not “Boat”.
  • ~ (tilde) – escapes the next character, so you can search for a literal asterisk or question mark. "*~?*" finds cells containing a question mark.

These wildcards work in the following functions: COUNTIF, COUNTIFS, SUMIF, SUMIFS, AVERAGEIF, AVERAGEIFS, VLOOKUP (when using approximate match), MATCH, and conditional formatting rules. They do not work in functions like FIND, SEARCH, or SUBSTITUTE, which treat wildcards as literal characters.

Practical Examples: Replacing LIKE with Wildcards

Suppose you have a list of product codes in column A and you want to count how many start with “AB”. In SQL you would write WHERE code LIKE 'AB%'. In Excel you write:

=COUNTIF(A:A,"AB*")

If you want to sum sales in column B where the product name in column A contains the word “Pro” anywhere, use:

=SUMIF(A:A,"*Pro*",B:B)

For a VLOOKUP that matches a partial ID, you can use a wildcard as the lookup value:

=VLOOKUP("*"&D1&"*",A:B,2,FALSE)

This finds the first product in column A that contains the text in D1. Note that VLOOKUP with wildcards only works when the last argument is FALSE (exact match). If you use TRUE (approximate match), wildcards are ignored.

How to Choose Between LIKE, Wildcards, and Other Methods

Your choice depends on what you are trying to do:

  • Simple counting or summing based on a pattern – use COUNTIF or SUMIF with wildcards. This is the easiest and most common approach.
  • Finding a value to return from another column – use VLOOKUP or INDEX/MATCH with wildcards.
  • Conditional formatting to highlight cells matching a pattern – use a formula rule like =ISNUMBER(SEARCH("Pro",A1)) or =COUNTIF(A1,"*Pro*").
  • Complex pattern matching with multiple conditions or case sensitivity – use VBA's Like operator. For example, VBA's Like is case-insensitive by default, but you can add Option Compare Binary at the top of the module to make it case-sensitive.
  • Extracting or transforming data based on patterns – use Power Query with Text.StartsWith, Text.Contains, or Table.SelectRows with Text.Contains.

If you need to match a pattern that wildcards cannot express (like “starts with A and ends with Z but has exactly 5 characters”), you can combine wildcards: "A???Z" matches exactly that. For more complex logic, you would need a helper column using multiple functions or VBA.

Common Problems and Misconceptions

One frequent issue is that wildcards do not work in functions like SEARCH or FIND. If you write =SEARCH("A*",A1), Excel looks for a literal asterisk, not a wildcard. To search for a pattern, you need to use COUNTIF or a helper column with ISNUMBER(SEARCH()). Another misconception is that wildcards are case-sensitive. In worksheet functions, they are not. COUNTIF(A:A,"a*") counts both “apple” and “Apple”. If you need case-sensitive matching, you must use VBA or a formula with EXACT combined with an array.

Another problem occurs when your data contains actual asterisks or question marks. For example, if you have product codes like “AB*CD” and you use COUNTIF(A:A,"AB*CD"), it will match “AB123CD” as well as “AB*CD”. To match only the literal asterisk, use a tilde: COUNTIF(A:A,"AB~*CD"). The tilde tells Excel to treat the next character literally.

Finally, VLOOKUP with wildcards can return unexpected results if your lookup column contains duplicate or similar values. It returns the first match, which may not be the one you want. In that case, consider using INDEX/MATCH with an array formula or Power Query.

If Wildcards Are Not Enough: VBA Like Operator

When you need the full power of LIKE, VBA is the way. The VBA Like operator supports the same wildcards plus character lists and ranges. For example:

If cell.Value Like "[A-C]*" Then matches any text starting with A, B, or C. You can also use [!0-9] to match any non-digit character. This is far more flexible than worksheet wildcards.

To use it, press Alt+F11 to open the VBA editor, insert a new module, and write a macro. For example, to count cells in column A that start with a digit:

Dim count As Long
Dim cell As Range
For Each cell In Range("A:A")
    If cell.Value Like "[0-9]*" Then count = count + 1
Next cell
MsgBox count

This is a simple example, but VBA can handle complex logic, loops, and even regex if you enable the Microsoft VBScript Regular Expressions reference. However, VBA macros are not available in Excel for the web or in the mobile app, and they require enabling macros in the desktop version, which some organizations restrict for security reasons.

Frequently Asked Questions

Does Excel have a LIKE function in the formula bar?

No. There is no worksheet function named LIKE that you can type into a cell. The LIKE operator exists only in VBA and Microsoft Query. For normal formulas, use wildcards with COUNTIF, SUMIF, or VLOOKUP.

How do I use wildcards in Excel for partial match?

Use an asterisk (*) for any number of characters, a question mark (?) for a single character, and a tilde (~) to escape a literal wildcard. For example, COUNTIF(A1:A10,"*cat*") counts cells containing “cat” anywhere.

Can I use LIKE in Excel for case-sensitive matching?

No. Worksheet wildcards are not case-sensitive. For case-sensitive matching, use VBA's Like operator with Option Compare Binary, or use a formula with EXACT and an array like =SUMPRODUCT(--EXACT(A1:A10,"Cat")).

Why doesn't my VLOOKUP with wildcard work?

VLOOKUP only supports wildcards when the last argument is FALSE (exact match). If you use TRUE, wildcards are ignored. Also, the wildcard must be part of the lookup value, not the table array. For example, =VLOOKUP("*"&D1&"*",A:B,2,FALSE).

Is there a way to use LIKE in Power Query?

Power Query does not have a LIKE function. Instead, use Text.StartsWith, Text.Contains, or Text.EndsWith in custom columns, or use Table.SelectRows with these functions. For example, Table.SelectRows(Source, each Text.Contains([Column], "Pro")).

Can I use wildcards in conditional formatting?

Yes. In the conditional formatting rule, choose “Use a formula to determine which cells to format” and enter a formula like =COUNTIF(A1,"*Pro*") or =ISNUMBER(SEARCH("Pro",A1)). The SEARCH version is case-insensitive; use FIND for case-sensitive.

Alternatives to LIKE in Excel

If wildcards are not enough, consider these alternatives:

  • Power Query – for data transformation, use Text.Contains, Text.StartsWith, or Text.EndsWith. These are more readable and can be combined with other steps.
  • Regular Expressions (Regex) – Excel does not have a native regex function, but you can use VBA with the VBScript.RegExp object. This is the most powerful option for complex patterns like email validation or phone number extraction.
  • Helper columns – break down your pattern matching into multiple columns using LEFT, RIGHT, MID, and ISNUMBER(SEARCH()). This is useful when you need to debug or when the pattern is too complex for a single wildcard.
  • Filter and Advanced Filter – for quick, one-off tasks, use the filter dropdown and select “Text Filters” > “Contains” or “Starts With”. This does not require any formulas.

In most cases, the built-in wildcard functions are sufficient for everyday tasks. Reserve VBA or Power Query for situations where you need case sensitivity, character ranges, or multi-condition logic that wildcards cannot express.