I'm just starting and trying to learn about google sheets and I've got a much more involved sheet than what I'm showing here, but essentially I have ten check boxes and those boxes are each given a unique value when checked. When not checked they are all 0.
In this image I have 10 boxes in column A, with their assigned ON values in column B. Column C1 has the =SUM formula.
What I'm trying to figure out is how to multiply the summed number if boxes 9 OR 10 are selected. So box 9 and 10 would still contribute their value for the sum function but then would also have a multiple value that is triggered for the summed total.
Thanks in advance for any help!!
edit: sorry, I think I've caused some confusion. The values in the B column are just a visual representation of the value of the assigned value of the check boxes themselves, they aren't actually necessary to be used, but I'll see if I can use any of the answers listed to logic my way through it! thanks!
CodePudding user response:
use:
=SUMPRODUCT(SUMIF(A1:A10, TRUE, B1:B10)*IF(A9=TRUE, B9, 1)*IF(A10=TRUE, B10, 1))
CodePudding user response:
Try this
=ArrayFormula(IFERROR(SUM(QUERY(VLOOKUP(
QUERY(IF(A1:A<>TRUE,,ROW(A1:A)), "Select * Where Col1 is not null",0),
QUERY({ROW(A1:A),B1:B}, "Select * Where Col1 is not null") ,2,0), " Select * where Col1 is not null "))*
PRODUCT(QUERY(VLOOKUP(QUERY(IF(A1:A<>TRUE,,ROW(A1:A)), "Select * Where Col1 is not null",0),
QUERY({ROW(A1:A),B1:B}, "Select * Where Col1 is not null") ,2,0), " Select * where Col1 is not null ")),""))
Test all checkboxes