Kevin Lamb
unread,Feb 10, 2012, 5:20:01 PM2/10/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to python-excel
I am running into a parse error while using xlwt. Simple formula's
like SUM() work fine but I tried to run this slight more complex
formula and received the following error.
xlwt.ExcelFormulaParser.FormulaParseException: can't parse formula
=COUNTIFS(hospital_data!C1:C6500,LEFT(B1,4),hospital_data!
D1:D65000,RIGHT(B1,1),hospital_data!F1:F65000,A3)
This is the code I am attempting to run.
hospital_count_formula = '=COUNTIFS(hospital_data!C1:C6500,LEFT({0},
4),hospital_data!D1:D65000,RIGHT({0},1),hospital_data!F1:F65000,
{1})'.format(quarter_ref, state_ref)
sheet_overview.write(row, column, Formula(hospital_count_formula))
I have tried using a defined numerical range (A1:A5000) instead of
(A:A) and I have also tried simply passing this through as a string
but it is not evaluated in Excel.
This formula does work when copy and pasted into Excel. Any thoughts
would be most appreciated.
Thank you!
Kevin