Count how often a value occurs
Let's say you want to find out how many times particular text or a number value occurs. For example:

If a range contains the number values 5, 6, 7, and 6, then the number 6 occurs two times.

If a column contains "Buchanan", "Dodsworth", "Dodsworth", and "Dodsworth", then "Dodsworth" occurs three times.
There are several ways to count how often a value occurs.
What do you want to do?
Count how often a single value occurs by using a function
Use the COUNTIF function to perform this task.
Example
The example may be easier to understand if you copy it to a blank worksheet.
How to copy an example

Create a blank workbook or worksheet.

Select the example in the Help topic.
Note Do not select the row or column headers.
Selecting an example from Help

Press CTRL+C.

In the worksheet, select cell A1, and press CTRL+V.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.


Function details
Count how often multiple number values occur by using functions
Let's say you need to determine how many salespeople sold a particular item in a certain region, or you want to know how many sales over a certain value were made by a particular salesperson. You can use the IF and COUNT functions.
Example
The example may be easier to understand if you copy it to a blank worksheet.
How to copy an example

Create a blank workbook or worksheet.

Select the example in the Help topic.
Note Do not select the row or column headers.
Selecting an example from Help

Press CTRL+C.

In the worksheet, select cell A1, and press CTRL+V.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.


Note

The formulas in the example must be entered as array formulas. After copying the example to a blank worksheet, select the formula cell. Press F2, and then press CTRL+SHIFT+ENTER. If the formula is not entered as an array formula, the error #VALUE! is returned.

For these formulas to work, the second argument to the IF function must be a number.
Function details
Count how often multiple text or number values occur by using functions
Use the IF and SUM functions to do this task:

Assign a value of 1 to each true condition by using the IF function.

Add the total, by using the SUM function.
Example
The example may be easier to understand if you copy it to a blank worksheet.
How to copy an example

Create a blank workbook or worksheet.

Select the example in the Help topic.
Note Do not select the row or column headers.
Selecting an example from Help

Press CTRL+C.

In the worksheet, select cell A1, and press CTRL+V.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.


Note The formulas in this example must be entered as array formulas. Select each cell that contains a formula, press F2, and then press CTRL+SHIFT+ENTER.
Function details
Count how often multiple values occur by using a PivotTable report
You can use a PivotTable report to display totals and to count the occurrences of unique values.

Select the column that contains the data. Make sure that the column has a column heading.

On the Insert tab, in the Tables group, click PivotTable.

The Create PivotTable dialog box is displayed.

Click Select a table or range.

Place the PivotTable report in a new worksheet starting at cell A1 by clicking New Worksheet.

Click OK.
An empty PivotTable report is added to the location that you specified with the PivotTable field list displayed.

In the field section at the top of the PivotTable field list, click and hold the field name, and then drag the field to the Row Labels box in the layout section at the bottom of the PivotTable field list.

In the field section at the top of the PivotTable field list, click and hold the same field name, and then drag the field again to the Values box in the layout section at the bottom of the PivotTable Field List.
Note If your data contains numbers, the PivotTable report totals the entries instead of counting them. To change from the Sum summary function to the Count summary function, select a cell in that column, and then on the Options tab in the Active Field group, click Field Settings, click the Summarize by tab, click Count, and then click OK.