Google-sheets – way to count how many entries in a given column have a particular value

google sheetsgoogle-sheets-chartstime series

I have a spreadsheet which keeps track of duels between two players in a game. Each row has the number of the match and the winner, given by their initial, X or Y. I want to know if it's possible to get a percentage for how many of the total matches have been won by player X or Y, and maybe make some sort of pie chart.

If that IS possible, then I'd also like to know if it's possible to group results by date. Imagine if there was a third column with the date of each match, would it be possible to create a pie chart for each month? October, November, etc.

Best Answer

Use COUNTIF, e.g. to get a percentage for how many of the total matches have been won by player X: =(COUNTIF(A2:A10,"=X")/COUNTA(A2:A10)*100.

For the grouping, I think you need to use QUERY (GROUP BY).