Excel Function: COUNTIF

The Excel function COUNTIF is used to count the number of cells that meet a specific criteria.


=COUNTIF(range_of_cells, criteria)

Example of use

The goal here is to count the number of people registered for the course (in other words, the number of people who answered "Yes"):

excel function countif

Select the COUNTIF function and then enter the range of cells containing the responses as well as the "Yes" criteria:


countif function png

Click OK.

The number of "Yes" responses is displayed:

If needed, you can download the Excel file used here: countif.xlsx
If you need to add additional criteria, use the COUNTIFS function.