ComputingRevision.net

Counting Cells which meet Specific Criteria

We use COUNT, COUNTA, and COUNTIF functions to quickly analyse and summarise data without manually checking each cell.

These functions help you to:

  • Analyse results
  • Create summaries

Examples:

  • Counting the number of test scores entered
  • Counting all non-empty cells
  • Counting cells which meet a condition

Counting Cells Containing Numbers

The COUNT function will count the number of cells containing a number. It does not add the values (use the SUM function to do that).

Try this…

The spreadsheet contains several cells containing different types of data.

  1. Click: C11
  2. Type: =COUNT(
  3. Select cells A2 to C9
  4. Type: ) and press enter.

The returned value should be 14.


Counting Non-empty Cells

The COUNTA function counts the number of cells which contain data.

  1. Click: C13
  2. Type: =COUNTA(
  3. Select cells A2 to C9
  4. Type: ) and press enter.

The returned value should be 22.

Change some of the values in the table to see how they affect the results of COUNT and COUNTA.


Count Cells that meet a Condition

COUNTIF is used to count cells which meet a specified condition. The syntax is:
=COUNTIF(range, criteria)

  • range is the cells to count
  • criteria is the criteria we want to count

Let's count the cells which contain "Cake":

  1. Click: C15
  2. Type: =COUNTIF(
  3. Select cells A2 to C9
  4. Type: , "Cake") and press enter (don't forget the comma!)


Now let's count the cells which contain a value greater than 10:

  1. Click: C17
  2. Type: =COUNTIF(
  3. Select cells A2 to C9
  4. Type: , ">10") and press enter (don't forget the comma!)