Google-sheets – How to add up the correct answers from the check boxes question

google sheetsgoogle-forms

What syntax do I use when adding up the number of correct answers that have boxes checked?

My question is;enter image description here

In this example the correct answers are Cotton and Calico.
I award the students a total of 2 marks ( 1 mark each) in selected. Therefore if a student selects Denim, Satin or Silk, they do not get a mark.

The current Syntax I have been using is something along the lines of;

=if(D2="Cotton.", "1", "0", "Calico.", "1", "0", "Demin.", "0", "0", "Satin.", "0", "0", "Silk.", "0", "0")

Best Answer

Two more to try:

=SUM(ArrayFormula(--regexmatch(split(D2,","), "Cotton|Calico")))

or

=SUM(ArrayFormula(countif(D2, {"*Cotton*", "*Calico*"})))