You can use the following methods to count names in Excel:
Method 1: Count Cells with Exact Name
=COUNTIF(A2:A11, "Bob Johnson")
Method 2: Count Cells with Partial Name
=COUNTIF(A2:A11, "*Johnson*")
Method 3: Count Cells with One of Several Names
=COUNTIF(A2:A11, "*Johnson*") + COUNTIF(A2:A11, "*Smith*")
The following examples show how to use each method with the following dataset in Excel:
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:
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:
We can see that there are 4 cells that contain “Johnson” somewhere in the 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:
We can see that there are 6 cells that contain either “Johnson” or “Smith” somewhere in the name.
Additional Resources
The following tutorials explain how to perform other common tasks in Excel:
How to Count Specific Words in Excel
How to Count Unique Values by Group in Excel
How to Use COUNTIF with Multiple Ranges in Excel