For each row, check if answer is correct and unique

jokr1

New Member
Joined
Jan 10, 2016
Messages
46
I have columns A-D, where A contains the correct answer to each question.
person1, person2 and person3 has the following answers. As you see person1 has got all the correct answers. But how can I count how many times person1 was the only one with the correct answer with a formula?
1624654029408.png
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Maybe this?

Code:
=SUMPRODUCT((A2:A6=B2:B6)*(A2:A6<>C2:C6)*(A2:A6<>D2:D6))
 
Upvote 0
Another way!

VBA Code:
=SUMPRODUCT(--(MMULT(--(B2:D6=A2:A6),{1;1;1})=1))
 
Upvote 0
like this for instance

Book3
ABCDEFGH
1correct answerp1p2p3step1: XOR checkstep2 convert Trues / false to 0,1step3: sum it up
21123TRUE12
33353FALSE0
42226FALSE0
58843TRUE1
64414FALSE0
7
Sheet1
Cell Formulas
RangeFormula
F2:F6F2=XOR(A2=B2,A2=C2,A2=D2)
G2:G6G2=--XOR(A2=B2,A2=C2,A2=D2)
H2H2=SUM(G2:G6)
 
Upvote 0
Excel 365
Excel Formula:
=SUM(--(MMULT((B2:D6=A2:A6)*(A2:A6=B2:B6),SEQUENCE(COLUMNS(B2:D6),,1,0))=1))
or (easier to change ranges)
Excel Formula:
=LET(correct, A2:A6, all, B2:D6, person, B2:B6,
SUM(--(MMULT((all=correct)*(correct=person),SEQUENCE(COLUMNS(all),,1,0))=1))
)
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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