On Wed, Dec 16, 2015 at 2:53 PM, John Machin <
sjma...@lexicon.net> wrote:
> SUMIFS was introduced in Excel 2007. xlwt produces Excel 2003-compatible
> files. No workaround known to me.
Right, it all depends on what the requirements are, and what
constitutes a "workaround".
If .xls files are a hard requirement, then of course the SUMIFS
function is completely unavailable. In order to meet this requirement,
you could (1) restructure your spreadsheet so that more basic Excel
functions could be used, perhaps with additional "work areas" set up
to hold temporary results; or (2) do the necessary calculations in
Python and just write the final results directly into the spreadsheet.
If .xlsx files are acceptable, then another possibility (which I find
more attractive), is to use XlsxWriter instead of xlwt. Then you can
keep the SUMIFS function, but you do have to adjust your Python
program somewhat to accommodate the differences between xlwt and
XlsxWriter. While potentially tedious (especially if you make heavy
use of XFStyle or easyxf), this is a very straightforward procedure.
John Y.