How can I count the number of “Yes” and “No” values in a range using Google Sheets?

To count the number of “Yes” and “No” values in a range using Google Sheets, you can use the COUNTIF function. First, select the range of cells you want to count. Then, type “=COUNTIF(range,”Yes”)” to count the number of “Yes” values or “=COUNTIF(range,”No”)” to count the number of “No” values. This will give you the total number of “Yes” or “No” values in the selected range. You can also use this function to count other values by changing the criteria within the quotation marks.


You can use the following formulas to count the number of “Yes” and “No” values in a particular range in Google Sheets:

Formula 1: Count Number of “Yes” Values

=COUNTIF(B2:B21, "Yes")

Formula 2: Count Number of “No” Values

=COUNTIF(B2:B21, "No")

Method 3: Count Percentage of “Yes” Values

=COUNTIF(B2:B21, "Yes")/COUNTA(B2:B21)

Method 4: Count Percentage of “No” Values

=COUNTIF(B2:B21, "No")/COUNTA(B2:B21)

The following example shows how to use each formula in practice with the following dataset in Google Sheets that shows whether or not various students passed a particular course:

Example: How to Count “Yes” and “No” Values in Google Sheets

We can type the following formulas in the following cells to count the number of “Yes” and “No” values in the range B2:B21:

  • E1: =COUNTIF(B2:B21, “Yes”)
  • E2: =COUNTIF(B2:B21, “No”)
  • E3: =COUNTIF(B2:B21, “Yes”)/COUNTA(B2:B21)
  • E4: =COUNTIF(B2:B21, “No”)/COUNTA(B2:B21)

The following screenshot shows how to use these formulas in practice:

Google Sheets count yes and no

From the output we can see:

  • There were 9 total “Yes” values in column B.
  • There were 11 total “No” values in column B.
  • A total of 45% of cells were equal to “Yes” in column B.
  • A total of 55% of cells were equal to “No” in column B.

Note that the COUNTA function counts the number of cells in a range that are not empty.

By dividing the result of the COUNTIF function by the COUNTA function, we’re able to calculate the percentage of total values that are equal to either “Yes” or “No” in column B. 

Additional Resources

The following tutorials explain how to perform other common operations in Google Sheets:

x