Return the Questions Answered Incorrectly on a Quiz

joshnelsontn

New Member
Joined
Jun 3, 2014
Messages
2
Hello,

I have a test I've created for new hires, and I need to identify which questions are answered incorrectly based off an answer column.

Question:Result:
1correct
2correct
3wrong
4correct
5not answered
6wrong
7wrong
8correct
9correct
10not answered

<tbody>
</tbody>
=INDEX(A:A,MATCH("wrong",B:B,0)) will return "3", but my desired output will be "3, 6, 7" (or something similiar).

Any ideas?

Thank you!!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
maybe....

=IFERROR(INDEX($A$1:$A$10,SMALL(IF($B$1:$B$10="wrong",ROW($A$1:$A$10)-ROW($A$1)+1),ROWS($D$1:D1))),"") control shift enter

assumes the question is in column A and the result is in column B
 
Upvote 0
joshnelsontn,

How about this?


Excel 2007
ABCDE
1Question:Result:wrong3
21correct3
32correct6
43wrong7
54correct
65not answered
76wrong
87wrong
98correct
109correct
1110not answered
12
Sheet1
Cell Formulas
RangeFormula
E1=COUNTIF(B:B,D1)
D2{=IF(ROWS($D$2:D2)<=$E$1,INDEX($A$2:$A$11,SMALL(IF($B$2:$B$11=$D$1,ROW($D$2:$D$11)-ROW($D$2)+1),ROWS($A$2:A2))),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.



Copy the array formula in cell D2 to range D3:D11
 
Last edited:
Upvote 0
Hi there,

Maybe either of these may suit.

First code you run and enter in the Input Box what answers you want listed in column F, "wrong", "correct" or "not answered"

The second code list all answers in columns E, F, G.

Regards,
Howard


Code:
Option Explicit

Sub WrongCorrectNoAns()

Dim myfind As String
Dim c As Range
[F:F].ClearContents
myfind = Application.InputBox(prompt:="Answers", Title:="Range Select", Type:=2)

For Each c In Range("B1:B" & Cells(Rows.Count, "A").End(xlUp).Row)
  If c = myfind Then
     c.Offset(0, -1).Copy Range("F" & Rows.Count).End(xlUp)(2)
  End If
Next

End Sub

'//***************************

Sub AllAnswers()

Dim myfind As String
Dim c As Range
Dim MyArr As Variant

[E:G].ClearContents

MyArr = Array("Correct", "Wrong", "Not answered")

Range("E1").Resize(, 3) = MyArr
              
For Each c In Range("B1:B" & Cells(Rows.Count, "A").End(xlUp).Row)
 If c = "correct" Then
     c.Offset(0, -1).Copy Range("E" & Rows.Count).End(xlUp)(2)
   ElseIf c = "wrong" Then
       c.Offset(0, -1).Copy Range("F" & Rows.Count).End(xlUp)(2)
   ElseIf c = "not answered" Then
       c.Offset(0, -1).Copy Range("G" & Rows.Count).End(xlUp)(2)
  End If

Next

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top