xlsxwriter: add formula with other sheet in it

十年热恋 提交于 2019-12-05 16:44:57

The issue is probably that the formula function names are in French but Excel expects it to be stored/written in English. At least in the files written by XlsxWriter.

Try this instead:

shInfo.write('G3','=COUNTA(Analyse!C:C)-1',information)
shInfo.write('G5','=COUNTIF(Analyse!D:D,"To change")',information)

If you send me a small sample file saved using a French version of Excel I'll have a look and see if it is possible to set a flag in the files written by XlsxWriter to indicate the language of the formulas.

Update: The COUNTIF() formula also needs to use the US style comma operator instead of ;. Update 2: Based on the sample file provided by @gatchan there is no language identifier in the file. The formula is translated to English and US style comma operator, by Excel, when it is saved .

Instead of write() method you should use write_formula():

shInfo.write_formula('G3','=NBVAL(Analyse!C:C)-1',information)
shInfo.write_formula('G5','=NB.SI(Analyse!D:D;"To change")',information)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!