View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
[email protected] bob.golightly@googlemail.com is offline
external usenet poster
 
Posts: 3
Default Count of Value based on another value

On Jul 26, 3:35 pm, Richhall wrote:
HI

I want to do a count of a value if another value is displayed in
another column. Its basically if someone gets something correct, I
want to know how many times they have got a particular answer. So a 1
in a column means that person has got the answer right, then if they
have a 1 i want to count how many times they have got a certain answer
against that 1?

I.e THis is a very long list, with a number of people and I want to
get stats.

Column A Column B COlumn C Column D
Answer Person A Person B Person C

Milk 1
1 0
Coke 1 1
1
Orange 0 1
1
Orange 1 1
0
Coke 0 1
0
Milk 0
1 1
Milk 1
1 1
Milk 0
1 0

Therefore

Person A has 4 correct
Person B has them all correct (8)
Person C has 4 correct

I want to create a summary though:

Person A Person B
Person C
Milk 2
4 2
Coke 1
2 1
Orange 1
2 1
TOTAL 4
8 4

Can anyone help please?

Cheers

Rich


Person A Person
B Person C
Milk 1
1 0
Coke 1
1 1
Orange0
1 1
Orange1
1 0
Coke 0
1 0
Milk 0
1 1
Milk 1
1 1
Milk 0
1 0
=COUNTIF(B2:B9,1)
=COUNTIF(C2:C9,1) =COUNTIF(D2:D9,1)

Person A Person
B Person C
Milk =SUMPRODUCT(($A$2:$A$9=$A$13)*(B$2:B$9=1)) =SUMPRODUCT(($A$2:$A
$9=$A$13)*(C$2:C$9=1)) =SUMPRODUCT(($A$2:$A$9=$A$13)*(D$2:D$9=1))
Coke =SUMPRODUCT(($A$2:$A$9=$A$14)*(B$2:B$9=1)) =SUMPRODUCT(($A$2:$A
$9=$A$14)*(C$2:C$9=1)) =SUMPRODUCT(($A$2:$A$9=$A$14)*(D$2:D$9=1))
Orange=SUMPRODUCT(($A$2:$A$9=$A$15)*(B$2:B$9=1)) =SUMPRODUCT(($A$2:$A
$9=$A$15)*(C$2:C$9=1)) =SUMPRODUCT(($A$2:$A$9=$A$15)*(D$2:D$9=1))
TOTAL =SUM(B13:B15)
=SUM(C13:C15) =SUM(D13:D15)