title: Add a column to sheet and apply this excel formula in whole column using python pandas or any other better library
body: <p>Need to Add a column to an existing sheet of excel file and apply this excel formula in whole column using python panda or any other better library and write it to existing excel file.
  The excel formula is:</p>
  
  <pre><code>=IF(AND(J2="SC",J3="EUS),K3-K2,"")
  </code></pre>
  
  <p>or</p>
  
  <pre><code>=IF(AND(currentRowOfCol J="SC",NextRowOfCol J="EUS),NextRowOfCol K-CurrentRowOfCol K,"")
  </code></pre>
  
  <p>Sample:</p>
  
  <pre><code>index J K
    1   2 3
    2   2 5
    3   7 2
  </code></pre>
  
  <p>Result Should be:</p>
  
  <pre><code>index J     K   L
    1   SC    4   1  
    2   EUS   5  NULL
    3   SC    2  NULL
  </code></pre>
  
  <hr>
  
  <p>Tried this code:</p>
  
  <pre><code>import openpyxl
  
  wb = openpyxl.load_workbook('C:/Users/Sameer/Desktop/abc.xlsx')
  Sheet = wb['Data Owner Group History']
  
  for cellObj in list(Sheet.columns)[12]:
  #    print(n)
      j1=('J'+str(cellObj.row))
      j2 = ('J'+str((cellObj.row)+1))
      y=('K'+(str((cellObj.row)+1)))
      k=('K2'+(str(cellObj.row)))
      n='IF(AND({0}="SC",{1}="EUS-CUC-DISPATCH (Ceryx/Amdocs group)"),{2}- 
      {3},"")'.format(j1,j2,y,k)
      cellObj.value = n
      wb.save("C:/Users/Sameer/Desktop/result.xlsx")
  print("done")
  </code></pre>
  
  <p>Buts it gets stuck at executing and never executes last command print("done"). It creates a result file but that is damaged and contains nothing. Will be better if someone can implement it using pandas so that the operation can be faster.</p>
  
  <p>Thanks in advance</p>