Google Sheets – Counting Matches Between Answer Key and Student Response

google sheets

I have a row containing an answer key for a multiple choice exam and then below that a number of rows containing the answers from students.

A very simple question: how can I count the number of "matches" between each student response row and the answer key row?

Example:

Answer key | 1 | 2 | 1 | 1 | 4 | 3 |
Bob        | 1 | 1 | 1 | 1 | 1 | 1 | <some formula magic that would give me '3'>
Steve      | 2 | 4 | 2 | 4 | 3 | 2 | <some formula magic that would give me '0'>
Jen        | 1 | 2 | 1 | 1 | 4 | 3 | <some formula magic that would give me '6'>

Best Answer

This did the trick for me: =arrayformula(sum(B$1:G$1=B2:G4))