Assuming that your example begins in cell A1, put this in cell B6 to replace XXX:
=ArrayFormula(sum(if(B2:B5=$A2:$A5,1,0)))
Question
Let's say I have data in a spreadsheet like so:
Correct Bob Alice
True True False
True True True
False False False
True False False
XXX YYY
As you can see Bob got three questions correct, while Alice got two.
What formula can I put in locations XXX and YYY to have the spreadsheet compute this for me?
Solution
Assuming that your example begins in cell A1, put this in cell B6 to replace XXX:
=ArrayFormula(sum(if(B2:B5=$A2:$A5,1,0)))