title: Calculating Molecular Weight Using Excel
body: <p>I have come across a bit of problem here.  I have a spreadsheet with about 9,000 organic compounds and I am trying to compute the molecular weight of all of them.  </p>
  
  <p>Normally, this would be easy: it's simply the number of elements in the molecular formula multiplied by the element's molecular weight and then you add them all up.  The problem is, the spreadsheet has the molecular formulas listed out as a string.</p>
  
  <p>For example, the molecular weight for "<strong>acetonitrile</strong>" is listed in a column as: <strong>C2H3N</strong>.</p>
  
  <p><strong>What I would like to do is write a function that scans that cell's contents and says, "Okay, every time I come across something that is text, look at the numbers immediately following it until you hit another text and then stop.  Then, take that number and multiply by that particular element's molecular weight" (I will take care of the summation of the molecular weights later because I feel that is is the easy part).</strong></p>
  
  <p>Is this possible to do with Excel's built in functions, or do I have to use VBA (which I really don't have experience with).  Any help here would be greatly appreciated.</p>