EPPlus not caluculating formula output after binding

穿精又带淫゛_ 提交于 2019-12-05 19:18:10

Try:

ws.Cells["A3"].Value = 2.3;
ws.Cells["A4"].Value = 10.2;

You were telling EPPlus to store the values as a string, that's why the formula failed.

also replace

ws.Cells["A5"].Formula = "=SUM(A3:A4)";

with

ws.Cells["A5"].Formula = "SUM(A3:A4)";

to result value of A5

perform Calculate() on the sheet, workbook or cell to ensure the formula executes. https://epplus.codeplex.com/wikipage?title=About%20Formula%20calculation

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