title: Excel: count number of common parameters for two values
body: <p>I have a list of materials with for each materials the parts that compose them.
  I would like to count for every possible material combination the number of common parts.</p>
  
  <pre><code>material    part
  mat 1       b
  mat 1       c
  mat 2       b
  mat 2       e
  mat 3       c
  mat 3       b
  
  
  
          mat 1   mat 2   mat3
  mat 1             1      2
  mat 2       1            1
  mat 3       2     1 
  </code></pre>
  
  <p>mat 1 &amp; mat 3 have two common parts: b &amp; c
  mat 1 &amp; mat 2 have one common part: b
  etc...</p>
  
  <p>Can I easily do this with a formula or will I need VBA for this?</p>
  
  <p>Thank you for your help</p>
  
  <p>FG</p>