Advertisement
Guest User

Untitled

a guest
Aug 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. from openpyxl import load_workbook
  2. wb = load_workbook(filename='Data.xlsx')
  3. ws = wb['Data']
  4.  
  5. ws.auto_filter.ref = "A1:E1"
  6.  
  7. ws["E1"] = 'Fillrate%'
  8.  
  9. ws["E2"] = round(((ws['C2'].value)/(float(ws['B2'].value))*100),2)
  10. ws["E3"] = round(((ws['C3'].value)/(float(ws['B3'].value))*100),2)
  11. ws["E4"] = round(((ws['C4'].value)/(float(ws['B4'].value))*100),2)
  12. ws["E5"] = round(((ws['C5'].value)/(float(ws['B5'].value))*100),2)
  13. ws["E6"] = round(((ws['C6'].value)/(float(ws['B6'].value))*100),2)
  14.  
  15.  
  16. wb.save("Analized_Data.xlsx")
  17.  
  18. ws["E2"] = round(((ws['C2'].value)/(float(ws['B2'].value))*100),2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement