Google Sheets beginner countif wildcards text-functions

How to Count Cells That Contain Specific Text in Google Sheets?

Count Cells with Specific Text is a Google Sheets function that counts the number of cells in a specified range that contain a specific word or partial text.. Formula Genius generates and validates this formula automatically from a plain-English prompt.

Struggling to count occurrences of a word or phrase in your data? Use the COUNTIF function with wildcards to easily achieve this.

The Formula

Prompt

"Count cells that contain a specific word or partial text in Google Sheets using COUNTIF with wildcards"

Google Sheets
=COUNTIF(A1:A10, "*word*")

This formula counts the number of cells in a specified range that contain a specific word or partial text.

Step-by-Step Breakdown

  1. A1:A10 is the range of cells you want to evaluate.
  2. The asterisks (*) are wildcards that represent any number of characters.
  3. "word" is the specific text you want to search for within the cells.

Edge Cases & Warnings

  • The search term is case-sensitive if using EXACT instead of COUNTIF.
  • Cells with leading or trailing spaces may not be counted unless trimmed.
  • Using special characters in the search term may yield unexpected results.

Examples

Prompt

"Range: A1:A5 contains 'apple', 'banana', 'apple pie', 'grape', 'pineapple'; search term: 'apple'"

Google Sheets
3
Prompt

"Range: A1:A4 contains 'dog', 'cat', 'doghouse', 'fish'; search term: 'dog'"

Google Sheets
2

Frequently Asked Questions

Can I count cells that contain multiple words?

Yes, you can use COUNTIF with multiple criteria by combining functions.

What if my search term includes special characters?

You may need to escape special characters or use a different approach.

Is COUNTIF case-sensitive?

No, COUNTIF is not case-sensitive by default.

Can't find what you need?

Describe any formula in plain English and Formula Genius will generate, explain, and validate it — instantly.