You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Counting/Sum Formula for check boxes AND numbers in a column

Using Numbers for Mac, I have a scenario where checkboxes are mostly used, but occasionally numbers are listed.

Is there a formula for getting a total of the count of TRUE checkboxes AS WELL AS the total of the listed numbers?

Posted on Jan 12, 2022 6:06 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 12, 2022 6:42 PM

A few ways are available with slightly different results


=COUNTIFS(B,"<>"&FALSE,B,"<>")

Counts all cells that are not FALSE and not blank. It counts all cells that have anything in them other than FALSE. This includes numbers and text and dates and all.


=COUNTIF(B,TRUE)+COUNT(B)

Counts all cells that are TRUE and all cells with numeric values. Numeric values are numbers, dates, durations but does not include boolean TRUE/FALSE.


=COUNTIF(B,TRUE)+COUNTIF(B,">=0")+COUNTIF(B,"<0")

Counts all TRUE and all numbers. Ignores all other data types. It will give a blue warning triangle if there is a date or duration anywhere in column B.


I am sure there are additional ways if none of these meet your needs.

15 replies
Question marked as Top-ranking reply

Jan 12, 2022 6:42 PM in response to Ben_Zam

A few ways are available with slightly different results


=COUNTIFS(B,"<>"&FALSE,B,"<>")

Counts all cells that are not FALSE and not blank. It counts all cells that have anything in them other than FALSE. This includes numbers and text and dates and all.


=COUNTIF(B,TRUE)+COUNT(B)

Counts all cells that are TRUE and all cells with numeric values. Numeric values are numbers, dates, durations but does not include boolean TRUE/FALSE.


=COUNTIF(B,TRUE)+COUNTIF(B,">=0")+COUNTIF(B,"<0")

Counts all TRUE and all numbers. Ignores all other data types. It will give a blue warning triangle if there is a date or duration anywhere in column B.


I am sure there are additional ways if none of these meet your needs.

Jan 14, 2022 9:29 PM in response to Ben_Zam

You are correct. I took "total of the count of TRUE checkboxes AS WELL AS the total of the listed numbers" to be the count of the checkboxes + count of the numbers. Reading it now it is obvious you want the count of the checkboxes + the SUM of the numbers. Try this instead:


=COUNTIF(C3:C124,TRUE)+SUM(C3:C124)


This will work as long as there are only numbers, checkboxes, and text. Durations and dates will cause problems.

Jan 14, 2022 7:57 PM in response to Barry

Thanks gain Barry (and others),

I think I'm getting closer.

However to seems as though the formula is only adding 1m regardless of the values in the numerical cells.

As you can see in the example below,

I have 27 boxes checked, and the number 6 one of the included cells,

and yet my total (bottom left of image) is 28, not 33

Jan 13, 2022 12:01 AM in response to Ben_Zam

Thanks for the screenshot. So what are you now trying to do with this table.


(Curious why you have all those mostly blank rows. This doesn't look like the kind of Numbers table one normally sees. Check out the templates at File > New in your menu to see examples of "Numbers style" tables. 'Checklist Total' is somewhat similar to yours.)


SG

Jan 13, 2022 10:36 PM in response to Ben_Zam

COUNT and COUNTIF are different functions.


COUNTIF(C3:C124,true) will count the rows in column C where the checkbox has been checked.


The ( following the first COUNT is not needed—the concave end of the COUNT token represents the required opening parenthesis for a function. When changing the first COUNT to COUNTIF, delete the ( before C3. The ) following true; will change shape to match the ;crescent moon shape of the two parentheses at the end of the formula ( and one of those two will change to the ) form, and may be deleted. (leaving it in place will likely result in an error message).


The + sign and the part of the formula after it (except for the extra ) ) is good as it stands.


Regards,

Barry


COUNT counts only cells which contain numbers or quasi numeric values.




COUNT(C3:C124 will count the number values in the named range of cells.



Jan 14, 2022 7:58 PM in response to Ben_Zam

apologies for the grammar above, let's try again...


Thanks again Barry (and others),

I think I'm getting closer.

However it seems as though the formula is only adding 1 regardless of the values in the numerical cells.

As you can see in the example below,

I have 27 boxes checked, and the number 6 one of the included cells,

and yet my total (bottom left of image) is 28, not 33

Jan 14, 2022 11:04 PM in response to Ben_Zam

"As you can see in the example below,

I have 27 boxes checked, and the number 6 one of the included cells,

and yet my total (bottom left of image) is 28, not 33"


That is a correct result for the formula you show in the same post.


COUNTIF(C3:C124,true) counts the number of checkbox cells that are checked (27)

COUNT(C3:C124)            counts the number of cells containing a number           ( 1)


27 + 1 = 28


See Badunit's post above for a formula that counts the checked boxes and sums the numbers in the cells in the specified range.


Regards,

Barry

Counting/Sum Formula for check boxes AND numbers in a column

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.