ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Grading Multiple Choice Exam (https://www.excelbanter.com/excel-worksheet-functions/188579-grading-multiple-choice-exam.html)

Jay Windley

Grading Multiple Choice Exam
 
I am setting up a spreadsheet for my students' answers to a multiple choice
test. One of the things I want to do is see how many students got each
question correct, and that is easy enough to do using COUNTIF. However, I am
having a hard time creating a function that will tell me how many questions a
student got correct.

Suppose the key is in row 1, columns B through K (so B1:K1), and below that
I have a row for each student (with student names in column A). So the first
student has his name in A2, and his answers in B2:K2. So how do I count the
number of cells in B2:K2 which match the corresponding cell in B1:K1? I'm
aware that I could do something hideous like
=IF(B2=B1,1)+IF(C2=C1,1)+...+IF(K2=K1,1)
but there has got to be a more elegant way! I know that I could also create
another column for each student that compares their responses to the key row,
but it seems like there should be a function to do this.

Thanks!


ExcelBanter AI

Answer: Grading Multiple Choice Exam
 
Yes, there is a more elegant way to count the number of correct answers for each student. You can use the SUMPRODUCT function to compare the student's answers to the key row and count the number of matches.
  1. In cell L1, enter the label "Score" to indicate that this column will contain the number of correct answers for each student.
  2. In cell L2, enter the following formula:

    Formula:

    =SUMPRODUCT(--(B2:K2=B1:K1)) 

    This formula compares the student's answers in cells B2:K2 to the key row in cells B1:K1. The double negative (--) converts the TRUE/FALSE values to 1/0 values, and the SUMPRODUCT function adds up the 1's to count the number of correct answers.
  3. Copy the formula in cell L2 and paste it into the cells in column L for all the other students.

Now you have a column that shows the number of correct answers for each student. You can use this column to calculate each student's percentage score by dividing their score by the total number of questions and multiplying by 100. For example, if there are 10 questions, you can enter the following formula in cell M2:

Formula:

=L2/10*100 

This formula divides the student's score in cell L2 by 10 (the total number of questions) and multiplies by 100 to get the percentage score. Copy the formula in cell M2 and paste it into the cells in column M for all the other students.

Bernard Liengme

Grading Multiple Choice Exam
 
Use =SUMPRODUCT(--($B$1:$K$1=B2:K2))
The $s allow you to copy down the column.
The double negation converts Boolean (True/False) to numbers (1/0) so
summing can occur.
best wishes (I'm glad I'm retired and exam marking is history for me!)
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme



"Jay Windley" <Jay wrote in message
...
I am setting up a spreadsheet for my students' answers to a multiple choice
test. One of the things I want to do is see how many students got each
question correct, and that is easy enough to do using COUNTIF. However, I
am
having a hard time creating a function that will tell me how many
questions a
student got correct.

Suppose the key is in row 1, columns B through K (so B1:K1), and below
that
I have a row for each student (with student names in column A). So the
first
student has his name in A2, and his answers in B2:K2. So how do I count
the
number of cells in B2:K2 which match the corresponding cell in B1:K1? I'm
aware that I could do something hideous like
=IF(B2=B1,1)+IF(C2=C1,1)+...+IF(K2=K1,1)
but there has got to be a more elegant way! I know that I could also
create
another column for each student that compares their responses to the key
row,
but it seems like there should be a function to do this.

Thanks!



Jay Windley[_2_]

Grading Multiple Choice Exam
 
Thank you so much for the quick reply, that worked fantastic!

Jay


"Bernard Liengme" wrote:

Use =SUMPRODUCT(--($B$1:$K$1=B2:K2))
The $s allow you to copy down the column.
The double negation converts Boolean (True/False) to numbers (1/0) so
summing can occur.
best wishes (I'm glad I'm retired and exam marking is history for me!)
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme



"Jay Windley" <Jay wrote in message
...
I am setting up a spreadsheet for my students' answers to a multiple choice
test. One of the things I want to do is see how many students got each
question correct, and that is easy enough to do using COUNTIF. However, I
am
having a hard time creating a function that will tell me how many
questions a
student got correct.

Suppose the key is in row 1, columns B through K (so B1:K1), and below
that
I have a row for each student (with student names in column A). So the
first
student has his name in A2, and his answers in B2:K2. So how do I count
the
number of cells in B2:K2 which match the corresponding cell in B1:K1? I'm
aware that I could do something hideous like
=IF(B2=B1,1)+IF(C2=C1,1)+...+IF(K2=K1,1)
but there has got to be a more elegant way! I know that I could also
create
another column for each student that compares their responses to the key
row,
but it seems like there should be a function to do this.

Thanks!





All times are GMT +1. The time now is 11:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com