I wrote a script that reads this .xlsx file, then creates a column that is the sum of the three other columns, and saves everything into a new file:
import pandas
df = pandas.read_excel("excel-comp-data.xlsx")
df["total"] = df["Jan"] + df["Feb"] + df["Mar"]
df.to_excel("excel-comp-data-formula-by-pandas.xlsx")
The issue with this code is that it does not create a formula, it just adds everything up and places the result in the newly created column.
When I later access the newly created file in libreoffice calc and manually modify any data in "Jan", "Feb", or "March" the corresponding data in the column "total" does not get updated.
I've have found some code snippets on SO that create formulas, but all of them use tools as xlsxwriter. How might I create a formula in pandas without using such tools?
Is it at all doable?
