Count true in google sheets

To count true in google sheets you can use the COUNTIF formula.

Here is how to count true in google sheets:

1. In an empty cell type =COUNTIF(

2. Select the range of cells where you want to count

3. Add a comma and then type TRUE

4. Add closing parentheses and press enter

5. This will output the number of cells with a value of “TRUE”


The formula to count true in google sheets will look like this:

=COUNTIF(A1:A10, TRUE)

Here A1:A10 is the range where you are counting the number of TRUE entries.

Here is an animation showing this in action:

Count true in google sheets

Note: Here you are counting TRUE entries in cells considering them as boolean fields. The above formula will also work for checkboxes with tick marks in the cell.

Table of content


Example of Count true in google sheets


Below, we have a list of cells in column A with true and false data in it. We want to count the number of TRUE and FALSE entries in column A.

Here is the data:

Count true in google sheets


To count TRUE in google sheets, use the COUNTIF formula like below:

countif formula


As you can see from above, the result outputs the count as 5. This means there are 5 TRUE entries found in column A.


To count FALSE in google sheets, use the COUNTIF formula like this:

=COUNTIF(A1:A10, FALSE)
countif formula


As you can see, the formula found 5 entries of FALSE value in column A.

The COUNTIF formula only counts cells with a single criterion as input. If you want multiple criteria, use the COUNTIFS formula.


Count true in google sheets having checkboxes

Using the same COUNTIF formula you can count the number of checkboxes with tick marks in google sheets.

Below we have a list of data in column A with some of the cells that have checkboxes in them. We need to count the total number of TRUE entries in column A.

count true in google sheets with checkbox


Use the formula =COUNTIF(A1:A10, TRUE)

countif with checkboxes


As you see here, the formula has counted 6 true entries which include 3 cells with a value of TRUE and 3 cells with checkboxes with tick marks. 

Count true in google sheets having text field (non-Boolean)

If the TRUE or FALSE value in the cell in google sheets is not a boolean but a text field, then you can first convert them to a boolean value and then use the COUNTIF formula to count the number of fields with true entries:

Let’s say, we have a list of true/false values like this: (Note that all are text fields)

Count true in google sheets having text field

Now select all the cells and click on Format > Number and then choose Automatic. This will convert the text to a boolean value.

Here is a demo showing the same:

Count true in google sheets having text field example

This will convert all text fields to boolean fields.

count true in google sheets

Now that all fields are boolean, you can use the COUNTIF() formula to count the TRUE and FALSE values.

count true in google sheets examples


Count true and false in google sheets and output 1 or 0

To count true in google sheets and output 1 for TRUE and 0 for false, we can use the combination of COUNTIF and ARRAY FORMULA.

Below in column A, we have a mix of TRUE, FALSE, and checkboxes. We want to output 1 for TRUE values and 0 for FALSE.

The formula for this is:

=ARRAYFORMULA(--(A1:A17))

arrayformula count true


Count 0 or 1 in google sheets


To count 0 or 1 in google sheets, we can use the below formulas:

=COUNTIF(A1:A10, 1)  

=COUNTIF(A1:A10, 0)

FAQ

How do I count yes and no in Google Sheets?

To count yes or no in google sheets, use the COUNTIF formula. Here is the formula for counting yes or no in column E:
=COUNTIF(E1:E20,”yes”)
Since yes or no are not boolean values, you need to treat them as strings or text values while writing the COUNTIF formula.

How do you count the number of true cells?

Use the COUNTIF formula to count the number of true cells if the cells are of boolean format. Use =COUNTIF(range, TRUE) to count the number of true cells.

How do you use COUNTIF formula?

The syntax for Countif formula is =COUNTIF(range_where_to_count, criteria)

How do I count cells with text in Google Sheets?

You can use the COUNTIF formula to count specific text in a given range of cells. To search and count multiple texts, you can use the COUNTIFS formula.

Wrapping up

In this tutorial, you learned how to count true in google sheets. Also, you saw how to count false, checkboxes with tick marks, and non-boolean text fields of true/false values.

Go ahead and start using this in your worksheet. Let me know in the comments if you face any issues.


Appendix

[1] COUNTIF formula in google sheets – Link

Further Reading

New to google sheets ? Start here

More related to Logical functions:

Logical functions in google sheets
Learn more about Google sheets Formulas.
Error handling in google sheets

30+ smart tools to supercharge your sheets