Google Sheets CountIf Checkbox: How to Count Checked Boxes
In this article
To count checked boxes in Google Sheets, use the formula =COUNTIF(range, TRUE). This works because Google Sheets treats a checked checkbox as the logical value TRUE and an unchecked box as FALSE. By targeting the range containing your checkboxes and specifying TRUE as the criterion, the spreadsheet instantly tallies every marked item.
What You'll Need
- A Google account with access to Google Sheets.
- A spreadsheet containing a range of checkboxes (inserted via Insert > Checkbox).
- A blank cell where you want the total count to be displayed.
Step-by-Step
- Identify your checkbox range: Look at your sheet and determine which cells contain the checkboxes you want to count. For example, if your checkboxes are in column B, from row 2 down to row 20, your range is
B2:B20. - Select the destination cell: Click on the empty cell where you want the final count to appear. This is typically a cell at the bottom of your list or in a summary header at the top of the page.
- Enter the formula: Type the following formula exactly as shown:
=COUNTIF(B2:B20, TRUE). ReplaceB2:B20with the actual range you identified in step one. - Press Enter: Once you hit the Enter key, Google Sheets will scan the specified range and return the number of checkboxes that are currently checked.
- Test the functionality: Click a few checkboxes to check them or uncheck existing ones. You will notice that the number in your destination cell updates in real-time as the status of the boxes changes.
- (Optional) Count unchecked boxes: If you need to know how many items are still pending or unchecked, repeat the process in a new cell but use the formula
=COUNTIF(B2:B20, FALSE).
Common Mistakes
One of the most frequent errors is putting the word TRUE in quotation marks. In Google Sheets, TRUE and FALSE are boolean values, not text strings. If you write =COUNTIF(B2:B20, "TRUE"), the formula will look for the literal text "TRUE" written in the cell rather than the logical state of the checkbox. This will usually result in a count of 0, even if all boxes are checked.
Another common mistake is selecting the wrong range. Users often include the header row (e.g., selecting B1:B20 when B1 is the title "Completed"). While this usually doesn't break the formula (since the text "Completed" is not TRUE), it is bad practice and can lead to confusion when auditing complex sheets. Always ensure your range starts exactly where the first checkbox is located.
Some users attempt to use the COUNT function instead of COUNTIF. The =COUNT() function only counts cells containing numbers. Since checkboxes are boolean values, not numbers, a standard COUNT formula will ignore them entirely, returning 0. Always use COUNTIF when you need to count based on a specific condition like a checkmark.
Tips
To make your sheet more dynamic, use named ranges. Instead of typing B2:B20, you can highlight that range, right-click, and select Define named range. Name it something like "TaskStatus". Your formula then becomes =COUNTIF(TaskStatus, TRUE). This is incredibly helpful if you add rows to your sheet later; you only have to update the named range once, and every formula using that name updates automatically.
If you want to calculate a percentage of completion, combine COUNTIF with the COUNTA function. For example, =COUNTIF(B2:B20, TRUE) / COUNTA(B2:B20) will give you a decimal representing the fraction of checked boxes. You can then click the "%" button in the toolbar to format this as a percentage. This turns a simple count into a progress tracker.
For those managing very large datasets, consider using a checkbox in a filtered view. If you have a filter applied to your sheet, COUNTIF will still count hidden rows. If you only want to count the checked boxes that are currently visible after filtering, you would need a more advanced combination of the SUBTOTAL and SUMPRODUCT functions, as COUNTIF does not ignore hidden rows.
Troubleshooting
If your formula is returning 0 despite boxes being checked, first check for quotation marks around the word TRUE. Remove them and try again. If that doesn't work, verify that the cells actually contain checkboxes and not just the words "TRUE" or "FALSE" typed manually. While they look the same to the formula, ensure you used the Insert > Checkbox menu to create them.
If you see a #REF! error, it usually means the range you referenced has been deleted or the formula is trying to reference itself (a circular dependency). Check that your destination cell is not inside the range you are counting. For example, if your formula is in cell B21, the range should be B2:B20, not B2:B21.
If you see a #NAME? error, you likely misspelled the function name. Ensure it is written as COUNTIF (one word, all caps or mixed case) and that there are no accidental spaces between the function name and the opening parenthesis.
If the count does not update immediately, check if your spreadsheet is in "Manual Calculation" mode (though this is rare in Google Sheets compared to Excel). Usually, a simple page refresh or clicking into the formula and pressing Enter again will force the sheet to recalculate the values.
Frequently Asked Questions
Can I count checkboxes across multiple sheets?
Yes, but you cannot do it with a single COUNTIF. You must add multiple COUNTIF functions together, such as =COUNTIF(Sheet1!A1:A10, TRUE) + COUNTIF(Sheet2!A1:A10, TRUE).
How do I count checkboxes based on another condition?
If you need to count boxes that are checked AND meet another criteria (like a specific date or category), use the COUNTIFS function (with an 'S'). For example: =COUNTIFS(B2:B20, TRUE, C2:C20, "Urgent").
Can I change the value of a checkbox from TRUE/FALSE to something else?
Yes. Select the checkboxes, go to Data > Data validation, and check the "Use custom cell values" box. You can then set "Checked" to be 1 and "Unchecked" to be 0. If you do this, your formula changes to =COUNTIF(B2:B20, 1).
Does this work on the Google Sheets mobile app?
Yes, the formulas work identically on iOS and Android. However, entering the formula is easier on a desktop. Once the formula is set up, checking and unchecking boxes on mobile will update the total count instantly.
What happens if a cell in the range is empty?
Empty cells are treated as neither TRUE nor FALSE in the context of a checkbox. The COUNTIF(range, TRUE) formula will simply ignore them and only count cells that are explicitly checked.