# How to count cells that start with specific text in Excel

Put the asterisk wildcard after the text: `=COUNTIF(A2:A12,D1&"*")` counts every cell that begins with the text in D1.

**Excel:** `=COUNTIF(A2:A12,D1&"*")` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D |
| --- | --- | --- | --- |
| Job title |  | Starts with | Senior |
| Senior Accountant |  | Titles |  |
| Accountant |  |  |  |
| Senior Data Analyst |  |  |  |
| Data Analyst |  |  |  |
| Seniority Review Lead |  |  |  |
| Junior Developer |  |  |  |
| Senior Developer |  |  |  |
| Developer, Senior |  |  |  |
| Office Manager |  |  |  |
| senior designer |  |  |  |
| Data Engineer |  |  |  |

Formula in D2: `=COUNTIF(A2:A12,D1&"*")`

Result: 5

## How it works

The asterisk stands for any number of characters, so `D1&"*"` becomes `"Senior*"`: "Senior" followed by anything. Because nothing comes before the text, the cell has to begin with it, which is why "Developer, Senior" is not counted.

COUNTIF ignores case, so "senior designer" counts, and so does "Seniority Review Lead", because it also starts with those six letters.

## Other ways

- `=SUMPRODUCT(--(LEFT(A2:A12,LEN(D1))=D1))`: Compares the first characters directly. Use it when you need to combine the test with other array conditions.
- `=SUMPRODUCT(--EXACT(LEFT(A2:A12,LEN(D1)),D1))`: A case-sensitive version: EXACT treats "senior" and "Senior" as different. (Leaves out "senior designer", which starts with a lowercase s.)

## Common mistakes

- "Senior*" also matches "Seniority". To match the whole first word, include the space: `=COUNTIF(A2:A12,D1&" *")`.
- Leading spaces break the match: " Senior Accountant" does not start with "Senior". Clean the column with TRIM first.
- Wildcards only work on text. A number like 4012 is not matched by `"40*"`; see the page on counting numbers that contain digits.

## Questions

**How do I count cells that start with one of several words?**

Add a COUNTIF per word: `=COUNTIF(A2:A12,"Senior*")+COUNTIF(A2:A12,"Junior*")`. A cell can only start one way, so nothing is counted twice.

**How do I count cells that start with a letter?**

Use the letter as the text: `=COUNTIF(A2:A12,"S*")`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/count-cells-that-start-with-specific-text
