Count Names in Google Sheets (3 Examples)


You can use the following formulas to count names in Google Sheets:

Formula 1: Count Cells with Exact Name

=COUNTIF(A2:A11, "Bob Johnson")

Formula 2: Count Cells with Partial Name

=COUNTIF(A2:A11, "*Johnson*")

Formula 3: Count Cells with One of Several Names

=COUNTIF(A2:A11, "*Johnson*") + COUNTIF(A2:A11, "*Smith*")

The following examples show how to use each formula with the following dataset in Google Sheets:

Example 1: Count Cells with Exact Name

We can use the following formula to count the number of cells in column A that contain the exact name “Bob Johnson”:

=COUNTIF(A2:A11, "Bob Johnson")

The following screenshot shows how to use this formula in practice:

Google Sheets count specific name

We can see that there are 2 cells that contain “Bob Johnson” as the exact name.

Example 2: Count Cells with Partial Name

We can use the following formula to count the number of cells in column A that contain “Johnson” anywhere in the name:

=COUNTIF(A2:A11, "*Johnson*")

The following screenshot shows how to use this formula in practice:

Google Sheets count cells with partial name

We can see that there are 4 cells that contain “Johnson” somewhere in the name.

We can confirm this is correct by manually identifying each name in the Employee column that contains “Johnson” somewhere in the name:

  • Bob Johnson
  • Mike Johnson
  • Arthur Johnson
  • Bob Johnson

There are indeed four employees with “Johnson” somewhere in their name.

Example 3: Count Cells with One of Several Names

We can use the following formula to count the number of cells in column A that contain “Johnson” or “Smith” somewhere in the name:

=COUNTIF(A2:A11, "*Johnson*") + COUNTIF(A2:A11, "*Smith*")

The following screenshot shows how to use this formula in practice:

Google Sheets count cells with one of several names

We can see that there are 6 cells that contain either “Johnson” or “Smith” somewhere in the name.

x