title: Formula or macro to group cells according to their values
body: <p>I am on a spreadsheet that needs to retitle cells based on the cell value and the values of the cells below it. Basically I have the below column, which is filled by a formula that links to another spreadsheet.</p>
  
  <pre><code>Column A
  EE
  EE
  SP
  EE
  CH
  CH
  EE
  SP
  CH
  CH
  EE
  </code></pre>
  
  <ul>
  <li>For an cell that has <code>EE</code>, and for which the cell below it is <code>EE</code>, then the first cell should read "EE Only".  </li>
  <li>For any cell that has <code>EE</code>, and for which the cell below it is <code>SP</code>, which is then followed by another <code>EE</code>, then the first two cells should read "EE+SP".  </li>
  <li>For any cell <code>EE</code> where the cell(s) below it are <code>CH</code>, then those cells should read "EE+CH".  </li>
  <li>And for any cell <code>EE</code> where the cells below it are <code>SP</code> and <code>CH</code>, then all of those cells should read "EE+FAM".</li>
  </ul>
  
  <p>The above column should then look like:</p>
  
  <pre><code>Column A
  EE Only
  EE+SP
  EE+SP
  EE+CH
  EE+CH
  EE+CH
  EE+FAM
  EE+FAM
  EE+FAM
  EE+FAM
  EE Only
  </code></pre>
  
  <p>It's a long table of values, and quite honestly I'm not even sure what the best way to go about this is.  </p>
  
  <p>Do I need to create a table of values to lookup against, or is there a macro that would be able to handle this?</p>