0

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?

4
  • Welcome to Web Applications Please add a brief description of your search/research efforts as is suggested in How to Ask. Also clarify if you literally what to count cells having checkbox but not cells having TRUE / FALSE values that not have a checkbox.
    – Rubén
    Jun 13 '20 at 14:19
  • I really don't think this was worthy of a downvote, I asked a very specific question which didn't need any further clarification to be answered. I could have written "I have searched various websites for ways to count checkboxes and haven't found any answers" but what value would that have added? Jun 15 '20 at 15:51
  • I don't know if you are addressing the comment to me, anyway, I didn't vote up/down your question yet. Regarding the research efforts have you already search the list of functions on the Google Editors Help center? Have you already ready developers.google.com/apps-script/guides/sheets?
    – Rubén
    Jun 15 '20 at 16:16
  • Yes I had a look at the available functions, but I suspected there wouldn't be a specific one for detecting checkboxes, and that the answer would most likely be to use basic functions in a specific way. Glorfindel's answer worked, anyway. Jun 16 '20 at 8:40
3

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)
1
  • Thanks so much for providing a useful answer, this worked. Annoyingly this was my first idea, I wrote it off because it didn't work - my implementation must have been flawed. Appreciate the help! Jun 15 '20 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.