up vote 1 down vote favorite
1
share [g+] share [fb]

In a spreadsheet in Google Spreadsheets, I have multiple-choice answers I would like to grade. One row (user 0) contains the answer key, and the other rows contain user answers.

User  Q1   Q2   Q3   Q4   Q5   Score
0     A    C    D    C    B
1     A    C    B    C    B    [need formula here]
2     B    A    C    D    B    [need formula here]

I'm trying to come up with a spreadsheet formula that would allow me to automatically calculate how many answers for a given user match up with the answer key, but I haven't had much luck.

Any suggestions?

link|improve this question

60% accept rate
feedback

1 Answer

There's a function on Google Spreadsheets called ARRAYFORMULA. Here's how to use it in your case:

=ARRAYFORMULA(SUM(IF(EXACT($B$2:$F$2,B3:F3),1,0)))

This saves from the repetition of typing out:

=SUM(IF(EXACT($B$2,B3),1,0), IF(EXACT($C$2,C3),1,0), IF(EXACT($D$2,D3),1,0), etc...)

Assuming your spreadsheet was setup like this:

   A     B    C    D    E    F    G
1  User  Q1   Q2   Q3   Q4   Q5   Score
2  0     A    C    D    C    B    key
3  1     A    C    B    C    B    4
4  2     B    A    C    D    B    1

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.