Google-sheets – way to count all cells containing a checkbox

google sheets

I'm creating a checklist using the to-do list preset, but I've made some changes to it that break the formula which tells you how many tasks you have completed out of the total number of tasks. Basically I've added dividers and blank cells for formatting reasons, and the formula relies on there just being two simple columns, one with checkboxes and one with text:

=CONCATENATE(COUNTIF($A$12:$A$631,TRUE), "/", COUNTA($B$12:$B$631), " completed  ")

What I need ideally is a way to make the second formula essentially count only if the cell contains a checkbox. Is there a way to do this, or an alternative way to accomplish what I'm trying to do?

Best Answer

It's hard (perhaps impossible?) to determine with a formula whether a cell contains a checkbox or not; you might need a Google Apps Script for that. As long as your 'other' cells don't have a TRUE or FALSE value, you could replace your formula with a simple

COUNTIF($A$12:$A$631,TRUE) + COUNTIF($A$12:$A$631,FALSE)