title: Count rows where two values appear together
body: <p>My data are in MS Excel:</p>
  <pre><code>  Col A Col B Col C Col D
  1 amy   john  bob   andy
  2 andy  mel   amy   john
  3 max   andy  jim   bob
  4 wil   steve andy  amy
  </code></pre>
  <p>So, in 4x4 table there are 9 different values.
  I need to create table to find how many times each PAIR is occurring in the same ROW. Something like this:</p>
  <pre><code>      amy  andy  bob  jim  john  max  mel  steve  will
  amy   0
  andy  3    0
  bob   1    2     0
  jim   0    1     1    0
  john  2    2     1    0    0
  max   0    1     1    1    0     0
  mel   1    1     0    0    1     0    0
  steve 1    1     0    0    0     0    0    0
  will  1    1     0    0    0     0    0    1     0
  </code></pre>
  <p>And I have no clue how to do it...
  To reiterate: no duplicated values in each row, each row has unique values, each value in separate cell, so there are column with values and within column values can duplicate.</p>
  <p>Any help will be much appreciated!</p>