How to Use COUNTIF Contains in Google Sheets

COUNTIF is a function in Google Sheets that allows you to count the number of cells that meet a specific criterion within a given range. To use COUNTIF with "contains" functionality, you can use wildcards in the criteria. The asterisk (*) wildcard character represents any series of characters, while the question mark (?) wildcard character represents any single character.

Here's a step-by-step guide on how to use COUNTIF with "contains" in Google Sheets:

  1. Open your Google Sheet.
  2. Identify the range of cells where you want to count the cells containing a specific text or value.
  3. Click on an empty cell where you want the result to be displayed.
  4. Type the formula using COUNTIF function and wildcards, depending on your criteria:
    • To count cells containing a specific text, use =COUNTIF(range, "*text*"), replacing range with the actual range of cells, and text with the specific text you're looking for.
    • To count cells containing a specific value, use =COUNTIF(range, "*value*"), replacing range with the actual range of cells, and value with the specific value you're looking for.
  5. Press Enter to get the result.

Example

Let's say you have a list of items in column A (from A2 to A10), and you want to count the cells containing the text "apple":

  1. Click on an empty cell where you want the result to be displayed, for example, B2.
  2. Type the formula =COUNTIF(A2:A10, "*apple*") and press Enter.
  3. The result will show the number of cells containing the text "apple" in the specified range (A2:A10).

Remember to replace "apple" with your desired text or value and adjust the range accordingly to your data.

Did you find this useful?