I would like to read in an excel spreadsheet to python / pandas, but have the formulae instead of the cell results.
For example, if cell A1 is 25, and cell B1 is =A1
Actually, it is doable. You currently have something like this
import pandas as pd
import numpy as np
a2_value = "=A1"
data = [1, "=A1", 3, 4]
s = pd.Series(list(data))
writer = pd.ExcelWriter('output.xlsx')
s.to_excel(writer, 'Sheet1', header=False, index=False)
writer.save()
What you can do is actually this:
import pandas as pd
import numpy as np
data = [1, '=CONCATENATE("=A1", '')', 3, 4]
s = pd.Series(list(data))
writer = pd.ExcelWriter('output.xlsx')
s.to_excel(writer, 'Sheet1', header=False, index=False)
writer.save()
That's as well formula, but =A1 will be visible instead of its value.