title: Openpyxl: We found a problem with some content
body: <p>I am getting the error message 'We found a problem with some content' opening a file I generated with openpyxl. The file is being generated by concatenating different xlsx files and adding additional formulas in further cells. </p>
  
  <p>The problem is caused by a Formula with an if-condition I am writing into a cell (the second for loop is causing the excel error message). </p>
  
  <p>That's the code: </p>
  
  <pre><code>import openpyxl as op
  import glob
  
  # Search for all xlsx files in directory and assign them to variable allfiles
  allfiles = glob.glob('*.xlsx')
  print('Following files are going to be included into the inventory: ' + str(allfiles))
  
  # Create a workbook with a sheet called 'Input'
  risk_inventory = op.load_workbook('./Report/Risikoinventar.xlsx', data_only = False)
  input_sheet = risk_inventory['Input']
  risk_inventory.remove(input_sheet)
  input_sheet = risk_inventory.create_sheet()
  input_sheet.title = 'Input'
  r_maxrow = input_sheet.max_row + 1
  
  # There is more code here which is not related to the problem
  
  for i in range (2,r_maxrow):
      if input_sheet.cell(row = i, column = 2).value == 'Top-Down':
          input_sheet.cell(row = i, column = 20).value = '=IF(ISTEXT(H{}),0,IF(H{}&lt;=1000000,1,IF(H{}&lt;=2000000,2,IF(H{}&lt;=4000000,3,IF(H{}&lt;=8000000,4,IF(H{}&gt;8000000,5,0))))))'.format(i,i,i,i,i,i)
      elif input_sheet.cell(row = i, column = 2).value == 'Bottom-Up':
          input_sheet.cell(row = i, column = 20).value = '=IF(ISTEXT(H{}),0,IF(H{}&lt;=1000000,1,IF(H{}&lt;=2000000,2,IF(H{}&lt;=4000000,3,IF(H{}&lt;=8000000,4,IF(H{}&gt;8000000,5,0))))))'.format(i,i,i,i,i,i)
  
  for i in range (2,r_maxrow):
      if input_sheet.cell(row = i, column = 2).value == 'Top-Down':
          input_sheet.cell(row = i, column = 21).value = '=IF(K{}="Sehr gering",1,IF(K{}="Gering",2,IF(K{}="Mittel",3,IF(K{}="Hoc",3,IF(K{}="Sehr hoch",3,0))))))'.format(i,i,i,i,i,i)
      elif input_sheet.cell(row = i, column = 2).value == 'Bottom-Up':
          input_sheet.cell(row = i, column = 21).value = '=IF(K{}="Sehr gering",1,IF(K{}="Gering",2,IF(K{}="Mittel",3,IF(K{}="Hoc",3,IF(K{}="Sehr hoch",3,0))))))'.format(i,i,i,i,i,i)
  </code></pre>
  
  <p>So depending on what information is in cell(row = i, column = 2) I want a specific formula in cell(row = i, column = 21). The first for loop works perfectly, second for loop causes the error message in excel and the formulas are not being pasted in)</p>
  
  <p>As you probably already see I am trying to code with Python for a week an have never ever tried coding before… </p>
  
  <p>Many thanks in advance!</p>