How to Use Google Sheet: CountIF

Peppubooks
5 min readMar 2, 2023

--

CountIF is a useful function in spreadsheets that allows you to count the number of cells within a range that meet a certain criteria. This function can be particularly helpful when you have a large dataset and need to quickly determine how many cells meet a certain condition.

In this blog post, we’ll explore how to use the CountIF function in Google spreadsheets, including some examples of how it can be used in real-world scenarios.

Using CountIF in Spreadsheets

To understand how CountIF works, we should understand the CountIF syntax. The syntax of CountIF is relatively straightforward. Here’s what it looks like:

=COUNTIF(range, criteria)=COUNTIF(range, criteria)

The range refers to the range of cells that you want to count. The range is always an A1 Notation. A1 notation is a syntax used to define a cell or range of cells with a string that sometimes contains the sheet name plus the starting and ending cell coordinates using column letters and row numbers. To understand the A1 notation follow the example here. A simple way to get the A1 notation of cells of interest, you can right click on your mouse, drag and select range of choice. Next, at the top-left of the sheet, you should see the range selected. For instance, in the example below, our range is A2:F13.

Next is criteria. The criteria, is the condition that you want to test for.

For example, if you wanted to count the number of cells in a range that contained the word apple, you would use the following formula:

=COUNTIF(A1:A10, "apple")

This would count the number of cells in the range A1:A10 that contain the word apple.

Now that you understand the basic syntax of CountIF, let’s take a look at some examples of how it can be used in spreadsheets.

Counting Cells with a Specific Value

In a spreadsheet, users are constantly dealing with numbers. Wether it is financial or statistical figures, the need to handle numbers efficiently is ever rising.

Suppose you have a spreadsheet that contains a list of students and their grades on a recent exam. Sometimes, teachers want to group students according to their scores. For instance, for a student to qualify for an A they need to score a 90 and above.

In order to do this, you’d want to count the number of students who scored above 90. Here’s how you would use the CountIF function to do this:

  1. Select the cell where you want to display the result.
  2. Type the following formula: =COUNTIF(A2:A8, ">90")

3. Press Enter.

This formula will count the number of cells in the range A2:A8 that contain a value greater than 90.

Counting Cells with a Text String

Suppose you have a spreadsheet that contains a list of employees and their departments. You want to count the number of employees who work in the Sales department. Here’s how you would use the CountIF function to do this:

  1. Select the cell where you want to display the result.
  2. Type the following formula: =COUNTIF(A1:B11, "Sales")

3. Press Enter.

This formula will count the number of cells in the range A1:B11 that contain the text string “Sales”.

Counting Cells with Multiple Criteria

While Analysing a Spreadsheet, you may want to use more than one criteria. For instance, if you have a spreadsheet that contains a list of products, their prices, and their availability and want to count the number of products that are both available and priced at #100 or above.

Here’s the syntax for multiple criteria:

=COUNTIFS(criteria_range1, criterion1, [criteria_range2, criterion2, ...])

Here’s how you would use the CountIF function to do this:

  1. Select the cell where you want to display the result.
  2. Type the following formula: =COUNTIFS(B2:B9, “>=100”, C2:C9, “Available”)

3. Press Enter.

This formula uses an array formula to count the number of cells in the range B2:B11 that contain a value greater than 100 and the range C2:C11 that contains the text string Available.

Conclusion

In this article, we have explored how to use the CountIF function to streamline analysis on your Spreadsheet.

CountIF is a simple yet powerful function that can be used to quickly count the number of cells in a range that meet a certain criteria. By understanding the basic syntax of CountIF and how it can be used in real-world scenarios, you can save time and streamline your spreadsheet analysis.

If you’d like to streamline your accounting and invoicing activities, tryout PayTrack. We have built an addon for freelancers and small businesses. Also, we have released an middleware to integrate your checkout flow to PayTrack. This way, you don’t need to write extra codes as your receipts and invoices are generated from the checkout point, tracked until they’re paid and recorded automatically in our bookkeeping tool.

Please, send a message to peppubooks@gmail.com if you have any questions or need help using PayTrack.

We’re starting a discord community for users who love to perform bookkeeping in a spreadsheet, you can join.

Interested in more about GoogleSheet? Check our previous articles:

--

--