Forum Discussion
Formula Help - Checkbox triggers and sums
- Apr 27, 2018
Hi Bryan,
You have to generate something countable, so please replace this:
=IF(D4,"0","")
With this:
=IF(D4,1,0)
Or directly you can sum the range of TRUEs and FALSEs using this formula:
=SUMPRODUCT(--(D4:D12))
Regards
Haytham
Hi PhilHSEP ,
You can use the SUMPRODUCT function
You have two columns, each has true or false values, so basically if you do an arithmetic operation, the TRUE will become 1 and the FALSE will become 0.
so for each column, you can use SUMPRODUCT.
if you true and false values are in cells A1:A5 for example, =SUMPRODUCT(--($A$1:$A$5))
these two negative signs will be considered as an arithmetic operation and will force the conversion of TRUE and FALSE values to 1s and 0s.
hope that helps. let me know if you have any other questions.
Abdelrahman Abdou,
Certified Microsoft Excel Expert, Consultant.
Founder, Owner @ ExcelBonanza.com
http://www.excelbonanza.com/ |
https://www.linkedin.com/in/abdelrahman-abdou-60240150 | https://www.youtube.com/channel/UC2-D2unZHustY_f6V7cj03Q | https://www.facebook.com/ExcelBonanza/
I tried the fix that you suggested but it does not seem to be working ? I changed the location of the cells array so that it would look for true/false in those cells where there were checkboxes. The type of checkbox I am inserting is the one that is added by clicking on developer, insert, form controls, checkbox. I edit the name to "> 1200 F" in order to identfy why a person would check the box, is this the reason that the result is not showing up in the cell I put the formula into ?
Any help greatly
- AAbdouOct 29, 2019Copper Contributor
You need to make sure to link the checkbox to a cell as well by filling the cell link field when you right-click on the checkbox and click on Format Control. You need to link the checkbox to a cell and this cell will have the result of checking/ un-checking the checkbox of TRUE/FALSE.
The formula I mentioned in the previous reply will help you count these TRUEs and FALSEs.
Abdelrahman Abdou,
Certified Microsoft Excel Expert, Consultant.
Founder, Owner @ ExcelBonanza.com
http://www.excelbonanza.com/ |
https://www.linkedin.com/in/abdelrahman-abdou-60240150 | https://www.youtube.com/channel/UC2-D2unZHustY_f6V7cj03Q | https://www.facebook.com/ExcelBonanza/
- PhilHSEPOct 29, 2019Copper Contributor
Here is the file I am working on. Each thermocouple (row) would have a series of two checkboxes in each cell. Each row would have two checkboxes. There would be 180 cells for each row filled with these checkboxes. They would totalize/sum and that number of uses would display in the red or blue cells for that row... Is there an easy way to do this without using much memory or computational space?
Any help greatly appreciated....Thanks very much for your help already..
Regards
Phil
- AAbdouOct 29, 2019Copper Contributor
Hi PhilHSEP .
You don't have your checkboxes connected to any cells, so you aren't going to be able to get any results from them.
You need to connect them to cells using the steps I explained on my previous reply. Once you connect them to cells, these cells will have TRUE/FALSE values depending on the checkbox being checked/unchecked, and then you can do all kinds of calculations on them.
Abdelrahman Abdou,
Certified Microsoft Excel Expert, Consultant.
Founder, Owner @ ExcelBonanza.com
http://www.excelbonanza.com/ |
https://www.linkedin.com/in/abdelrahman-abdou-60240150 | https://www.youtube.com/channel/UC2-D2unZHustY_f6V7cj03Q | https://www.facebook.com/ExcelBonanza/