Sumproduct.evaluate fails with formula: SUMPRODUCT(A1:A3,--(B1:B3="a")). It gets ErrorEval as 2. arg. Therefore sheet.autoSizeColumn(columnIndex, true) fails to autosize column even when XSSFFormulaEvaluator.evaluateAllFormulaCells(wb) is called just before, as Sumproduct evaluation fails. Example code and discussion in StackOverflow: https://stackoverflow.com/questions/64642612/apache-poi-autosizecolumn-with-sumproduct-and-xssfformulaevaluator-is-not-workin