from openpyxl import load_workbook path = 'valami.xlsx' wb = load_workbook(path) sheet = wb.worksheets[0] sheet.cell(row = 1, column = 1).value = 35 sheet.cell(row = 2, column = 1).value = 42 sheet.cell(row = 3, column = 1).value = 16 sheet.cell(row = 4, column = 1).value = '=sum(a1:a3)' wb.save(path)