Apache poi setformula doesn't work With SE

点点圈 提交于 2019-12-11 02:43:02

问题


I'm trying ti set a formula in a XSSFCell With POI.

Cell.setFormula("SE(D87=0; ""; D80/D87)");

The error is:

Name 'SE' is completely unknown in the current workbook.

Why?


回答1:


It looks like you are attempting to create an IF formula. I found this page about Excel formula translations into different languages, where I found that the English formula name IF translates to SE in a few languages.

I don't believe that Apache POI supports formula names in names other than English. Try the English name. You may or may not need to replace the semicolons with commas; I'm not sure if Apache POI takes that into account.

cell.setCellFormula("IF(D87=0, \"\", D80/D87)");


来源:https://stackoverflow.com/questions/15253212/apache-poi-setformula-doesnt-work-with-se

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!