title: Match names in column A and B, then count occurrences in C
body: <p>We have a scoring spreadsheet which tracks games played and the winner of each match. We have the following columns </p>
  
  <ul>
  <li>column A (name1)</li>
  <li>column B (vs)</li>
  <li>column C (name2)</li>
  <li>column D (winner name)</li>
  </ul>
  
  <p>I have used</p>
  
  <pre><code>=SUMPRODUCT((A:A="name1")*(C:C="name2")+(A:A="name2")*(C:C="name1"))
  </code></pre>
  
  <p>to count how many games this particular pairing have played, simply because as the games are entered by different people names are in either column.</p>
  
  <p>Now I need to find a way to count the amount wins from the games these two have played, obviously the formula above is redundant for this.</p>
  
  <p>So in effect, match from column A and C <code>name1</code> and <code>name2</code> and count how many <code>name1</code> exists in column D.</p>