Apache poi setformula不适用于SE [英] Apache poi setformula doesn't work With SE

查看:133
本文介绍了Apache poi setformula不适用于SE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在带有POI的XSSFCell中设置公式.

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

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

错误是:

名称"SE"在当前工作簿中是完全未知的.

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

为什么?

推荐答案

您似乎正在尝试创建IF公式.我发现此页面关于将Excel公式转换为不同语言的信息,发现英文公式名称IF可以几种语言翻译为SE.

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.

我不认为Apache POI支持英语以外的其他名称的公式名称.尝试使用英文名称.您可能需要,也可能不需要用逗号替换分号.我不确定Apache POI是否考虑到了这一点.

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)");

这篇关于Apache poi setformula不适用于SE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆