1

Using Google Sheets I have the following setup:

------------------------------------------------
| Game        | Player 1 | Player 2 | Player 3 |
------------------------------------------------
| Racing      | L        | W        | X        |
| Sonic 2     | W        | L        | X        |
| Sonic 2     | W        | X        | L        |       
| Sonic 2     | L        | X        | W        |
| Racing      | L        | W        | X        |
| Racing      | L        | W        | X        |
------------------------------------------------

Each "game" is a two player game.

  • W represents a win

  • L represents a loss

  • X represents did not play

I want to calculate the following and output it to cells:

  1. Total wins at game "Racing" for player 1.
  2. Total losses at game "Racing" for player 1.
  3. Wins at game "Racing" for player 1 while playing against player 2.
  4. Losses at game "Racing" for player 1 while playing against player 2.
  5. Wins at game "Racing" for player 1 while playing against player 3.
  6. Losses at game "Racing" for player 1 while playing against player 3.

    etc.

How can I do this?

Community
  • 1
  • 1

2 Answers2

0

You will want to look into using the SUMIF function. You can set up a function to take the sum's a column's cell has a specific value. With this, you can also embed additional if statements. That is what I would use if using excel.

I haven't used this function in google docs, but if its not supported yet, then try the below link that mentions it. SUMIF work around

NickG
  • 871
  • 3
  • 11
  • 18
0

Check out the answer to SUMIFS function in Google Spreadsheet

Basically you want something like:

=ARRAYFORMULA(SUM(((Games!$A:$A)=$A2) * ((Games!$B:$B)='W') * (1) ))

Where Games is the sheet with your game information and $A2 is the cell with the values as Racing, Sonic 2 etc.

Community
  • 1
  • 1
Guy
  • 12,388
  • 3
  • 45
  • 67