I have a Google Sheets database like this:
Name | Value | Answer
A | 100 | Y
B | 200 | N
C | 10 | Y
A | 100 | N
A | 1000 | Y
B | 50 | Y
B | 200 | N
And I want, by using QUERY
, to get the total percentage of "Answer" like this:
Answer | %Total
Y | 57%
N | 42%
And the percentage of Y and N per name:
Name | Sum | Count | %Y | %N
A | 1200 | 3 | 28% | 71%
B | 450 | 3 | 14% | 85%
C | 10 | 1 | 14% | 85%
Here's what I have so far:
=QUERY(Data!A1:C8;"SELECT A, SUM(B), COUNT(B) group by A")
I got the SUM
and the COUNT
, but couldn't figure how to get the percentage as cited above.
Could somebody with more experience please help with that?