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

查看:28
本文介绍了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天全站免登陆