title: Count number of unique combinations of two columns
body: <p>I have a spreadsheet of statistics from sports games over a season, for different leagues - each row holds a single event that happened in a game, such as a penalty. There are many rows of events for each individual game. One of the columns is the league, another is the home team and another is the away team. How can I count the total number of games in a given league? In other words, I would need to count the number of unique pairs of strings from Home and Away, where League = "Ligue 1".</p>
  
  <p><a href="https://i.stack.imgur.com/JcvAG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JcvAG.png" alt=""></a></p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I have tried:</p>
  
  <pre><code>=SUMPRODUCT(1/(COUNTIFS(E2:E81078,"Ligue 1",F2:F81078,F2:F81078,G2:G81078,G2:G81078)))
  </code></pre>
  
  <p>which returns a <code>DIV/0</code> error (it does work if I dont include the column E = "Ligue 1" criteria).</p>