title: Complex formula to count uniques is counting one too many
body: <p>I have an issue with computing the number of unique <code>patients</code> and/or <code>MRN</code>.  I crossed referenced one patient to their respective ID three times to make sure every patient only has exactly one unique <code>MRN</code>, even those they may appear more than once in the Excel database.  My problem is using the formula:</p>
  
  <pre><code>=SUM(IF(FREQUENCY(MATCH(E4:E317,E4:E317,0),MATCH(E4:E317,E4:E317,0))&gt;0,1))
  </code></pre>
  
  <p>for the names of patients, results in <code>94</code>, which I'm confident is correct, but:</p>
  
  <pre><code>=SUM(IF(FREQUENCY(MATCH(F4:F317,F4:F317,0),MATCH(F4:F317,F4:F317,0))&gt;0,1))
  </code></pre>
  
  <p>for the <code>MRN</code> of patients results in <code>95</code>, which does not match.  This initially prompted me that maybe a patient accidentally has two <code>MRN</code>. However, when I crossed-referenced multiple times to make sure one entry at a time, this is not so. </p>
  
  <p>Any ideas why this occurred?</p>