Skip to content

Stockertim Dictionary · Technology

Wildcard character

Also called wildcard characters, wildcard, wildcards

In short

A symbol in a text condition that stands for unknown characters: an asterisk matches any run of characters and a question mark matches exactly one.

  • Intermediate
  • Concept
  • Checked

In detail

Spreadsheet conditions normally compare whole values, but wildcards allow partial matches. The asterisk stands for any number of characters, including none, so "*Ltd" matches every name ending in Ltd and "*bank*" matches any text containing bank. The question mark stands for exactly one character, so "INV-20??" matches INV-2025 and INV-2026 but not INV-202.

Wildcards work in the functions built around matching: COUNTIF, COUNTIFS, SUMIF, SUMIFS and AVERAGEIFS, MATCH and VLOOKUP when they are set to exact match, and XLOOKUP when its match mode is set to allow wildcards. They also work in the search and filter tools. They do not work in a plain comparison, so =A2="*Ltd" looks for the literal text *Ltd rather than a pattern.

To search for a real asterisk or question mark, the character is preceded by a tilde, as in "~*". Conditions can also be built from cells: "*"&F1&"*" finds any text containing whatever is typed in F1, which is handy for a simple search box on a sheet.

The convenience brings a risk of over-matching. A pattern such as "*Ade*" catches Adebayo and also Kadeem, and a short code matches longer codes that contain it. Results built on wildcards deserve a quick look at which rows were caught. Databases use the same idea with different symbols: SQL's LIKE uses % for any run and _ for a single character.

Worked example

A procurement officer in Cardiff counts suppliers whose names end in Ltd in a list of 40 names.

  1. Formula: =COUNTIF(A2:A41,"*Ltd")
  2. It counts 18 names ending in Ltd and ignores 22 others, including names with Ltd in the middle

The asterisk stands for whatever comes before Ltd, so 18 names are counted.

In practice

Wildcards help to total spending with suppliers whose names vary slightly, count invoice numbers from one year, and find records by part of a reference.

Watch out

  • Patterns can catch more rows than intended; inspect the matches before relying on the total.
  • Wildcards apply to text only and do nothing in a plain = comparison.

Learn it properly

Official sources

Facts last checked on 9 November 2026.

Education, not advice: the Stockertim Dictionary explains what terms mean. It never recommends buying or selling anything.

English