title: Using Excel to create part numbers based on 4 levels of categories that each have unique identifiers based on the category combinations
body: <p>I am using Excel 2010 and have a list of products (~8000) that I need to create product code / part numbers for. These product numbers need to be based on 4 levels of categories, where each category has a code (2-3 digits of numerical values). For example:</p>
  
  <ul>
  <li>Model01: 15
  <ul>
  <li>Primary Category01: 11
  <ul>
  <li>Secondary Category01: 45
  <ul>
  <li>Tertiary Category01: 22</li>
  </ul></li>
  </ul></li>
  <li>Primary Category02: 22
  <ul>
  <li>Secondary Category02: 50
  <ul>
  <li>Tertiary Category02: 23</li>
  </ul></li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>So for example says Product A has the categories of Model01 > Primary Category01 > Secondary Category01 > Tertiary Category01 it would have a product code of 15-114522. I have this where it works in Excel. HOWEVER, at the end of each "Category Code" I also want to have a unique number to differentiate products in the same category combination. So I would want Product A to have a product code of 15-114522-XX (XX being a unique identifier number that auto increments only for that combination of categories). So 15-114522-XX and 15-123456-XX could both use 15 in the place of XX.</p>
  
  <p>So far I have tried finding the duplicates using COUNTIF and then ranking them sequentially so that each category code that was duplicated was ranked with a unique number, but that ranked all duplicates (different category combinations that were both duplicated. I found the formula to rank sequentially here: <a href="http://support.microsoft.com/kb/152567/en-us" rel="nofollow">http://support.microsoft.com/kb/152567/en-us</a></p>
  
  <p>So I need a way to generate existing part numbers and a way to continually generate new part numbers if we add products. </p>
  
  <p>I really feel like Excel is not the best way to do this, so if you have another suggestion for a way to do it I would be glad to hear it. I know some PHP, so if I could use PHP and MySQL Database that would be fine. I feel like this might need to use VBA to accomplish this through Excel(which I do not know, but I am sure I can figure out).</p>
  
  <p>I realize that this is an extremely hard thing to understand so I will also link a Google Doc of the Spreadsheet where you can view it or download it if you would like.</p>
  
  <p><strong>Google Spreadsheet</strong>: <a href="https://docs.google.com/spreadsheet/ccc?key=0AlXmrYIdv91SdEFQVklURkdTZER0NFkxZ1B4ZFdZYXc" rel="nofollow">https://docs.google.com/spreadsheet/ccc?key=0AlXmrYIdv91SdEFQVklURkdTZER0NFkxZ1B4ZFdZYXc</a></p>
  
  <p>I would appreciate any and all responses. Let me know if you need anymore information and I will do my best. Thank you!</p>
  
  <p>-Jacob</p>