manish449
manish449

Reputation: 541

xlwt cannot parse formula xlwt.Formula("SUM(R[-110]C:R[-1]C)")

I am trying to add the above mentioned formula to my script and get a parsing error, if I remove the xlwt.formula bit and replace with an = then excel doesn't read the it as a formula and just prints the string.

Any ideas what I am doing wrong?

Upvotes: 2

Views: 7509

Answers (1)

Benjooster
Benjooster

Reputation: 552

This is a great document on xlwt formulas.

https://github.com/python-excel/xlwt/blob/master/examples/formulas.py

Have you tried:

w = Workbook()
ws = w.add_sheet('NewWorksheet')

ws.write(0, 0, Formula("SUM(R[-110]C:R[-1]C)"))

Upvotes: 9

Related Questions