title: openpyxl iterate through rows and apply formula
body: <p>I am trying to iterate through the rows of a particular column in an Excel worksheet, apply a formula, and save the output. I'm struggling to get my code right and am not sure where to go next. </p>
  
  <p>My code so far:</p>
  
  <pre><code>import openpyxl
  
  wb = openpyxl.load_workbook('test-in.xlsx')
  sheet = wb.worksheets[2]
  maxRow = sheet.max_row
  
  for row in range(2, maxRow)
  
  
  
  wb.save('test-out.xlsx')
  </code></pre>
  
  <p>So I'm not clear how to write my for loop to write the results of applying the =CLEAN(D2) formula, in column E. I can apply the formula to a single cell with:</p>
  
  <pre><code>sheet['I2'] = '=CLEAN(D2)'
  </code></pre>
  
  <p>However I'm not sure how I can incorporate this into my for loop!</p>
  
  <p>Any help much appreciated...</p>