Apache POI evaluate formula

To promote a comment to an answer…

You firstly need to ensure you’re using the same version of POI for the main jar, and the OOXML part. Your maven snippet was showing 3.7 for one, and 3.8 beta 1 for the other. You need to make sure they’re both the same. (You might even want to use 3.8-beta2 which is just out).

Then, use either:

FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();
evaluator.evaluateFormulaCell(cell);

or:

XSSFFormulaEvaluator.evaluateAllFormulaCells(wb);

See http://poi.apache.org/spreadsheet/eval.html for more details

Leave a Comment