Arrow left
Back to guides
Google Sheets Formulas

How to Use COUNTIF Function in Google Sheets

In this article, you will learn how to count the number of cells with the COUNTIF function. This formula is beneficial when you want to count the number of cells that meet a specific condition (e.g., specific name, figure, and date).

How to use the COUNTIF formula in Googles Sheets

  • Type “=COUNTIF(” or go to “Insert” in the menu bar ➝ “Function””Math””COUNTIF”.

  • Select a set of data in which you want to find the number of cells that match a particular condition.

  • After adding a comma, you need to choose a cell containing the specific standard or input the criterion directly.

  • Press the “Enter” key.

How to insert the COUNTIF function from the menu bar

The generic formula is as follows.

=COUNTIF(range, criterion)

Range: This is the field in which the formula looks for items that match the criterion.

Criterion: This is the standard you apply.

Why spend hours creating spreadsheets, when we have already done the work for you?
100+ financial spreadsheet templates, all free and ready for you now.
Free Spreadsheet Templates

See some examples below. Assume you are a finance manager trying to analyze sales records shown in the picture below. You want to know the number of deals by Sales Person, Lot Size, and Record Date.

How to use the COUNTIF function in Google Sheets with examples

(i) The number of deals by Sales Person

The first thing you need to do is to identify all items in a list without any duplications or lacks. Make sure you list all names in the original data in your summary table. The range of the formula is C4:C13.

As stated above, the criterion, whatever it is, can be input by cell reference or manual input. We are showing examples of manual input in the first two formulas, ones for Anna and Bryan, and cell reference in the third and fourth formulas, ones for Charlie and David. In cases of cell references, the referred cells are next to the cells that contain the COUNTIF formulas.

We do the same for the other two examples (ii) and (iii). However, note that we highly recommend you use cell references as much as possible and you make the format of formulas (e.g., manual input or cell reference for a criterion) consistent. 

Another important thing you should bear in mind is you calculate the total figure of computed values and make sure it matches the number of items in the original data. In this example, the total figure should be 10 as the original data table contains ten deals.

(ii) The number of deals by Lot Size

This example shows how to incorporate a number as a criterion in the COUNTIF formula.

(iii) The number of deals by Record Date

In the third example, you can see how to include a date as a criterion in the formula. 

If you want to learn how to manually input text, number, and date in a formula, as a range or a criterion, check this article.

How do I use COUNTIF in multiple Google Sheets?

You can contain a set of data on a different worksheet in the COUNTIF formula. However, we recommend you gather the necessary information on a sheet by using the cell reference or copy&paste function so that you can avoid incorrect references and little visibility of data resources.

If you still need to know how to refer to a series of data in a different sheet in a formula, check this article: How to Reference Another Sheet in Google Sheets

Sheets tutorials availalble now in our free certificate program!
Learn basic and intermediate functions with digestible videos and instructions.
Enroll in LiveFlow Academy

Can you do the COUNTIF with multiple criteria Google Sheets?

Yes, you can. For instance, if you want to count the number of cells which meet criterion A or criterion B in a set of data (range C), you can find the answer by adding up the results from two separate COUNTIF formulas like “=COUNTIF(range C, criterion A)+COUNTIF(range C, criterion B)”.

However, if you would like to seek the number of cells that meet both criteria A and B, you should use the COUNTIFS function instead of the COUNTIF formula.

How do I use the COUNTIFS in Google Sheets?

Check this article to learn how to utilize the COUNTIFS function in Google Sheets.

The world's top businesses trust LiveFlow to automate their financial reporting
We turn Quickbooks Online data into a live FP&A dashboard in Sheets FAST!
Book a Demo

Learn how to do this step-by-step in the video below 👇

Automate financial reporting with LiveFlow

Want to eliminate manual updates of your Excel & Google Sheets models?

Yes, show me how

Need help?

Our team is here to help you any time between 9am and 10pm EST.
Check Icon
Email us at:

Liked this article? Then you'll love the ones below