The asterisk in COUNTIF criteria is a wildcard that matches any sequence of characters, including an empty string. So "*Error*" matches any text that has zero or more characters, then the word Error, then zero or more characters — which is any cell that contains Error anywhere. Text matching is case-insensitive, so this pattern catches Error, error, ERROR, and mixed-case variants without you having to think about it. If the cell contains the search text more than once, it still only counts as one match — COUNTIF does not count occurrences within a cell. A subtle trap: because the wildcard matches zero or more characters, searching for "*cat*" will also match catalog, category, or scatter because those words contain the letters cat. If you need whole-word matching only, add spaces around the search text inside the wildcards, or use SUMPRODUCT with FIND for case-sensitive and more precise control. When you want the search term to come from another cell rather than being hard-coded, concatenate the wildcards with the cell reference using the & operator — the
COUNTIF function accepts the built-up string transparently.