这是公式在 excel 中的显示方式:
我想在 Excel 中使用来自 c# 的 EPPLUS 预测公式。代码中的公式是正确的,但是在Excel中出现=@FORECAST(params).
ExcelRange targetDate = sheet.Cells[listItems + 2, 2];
ExcelRange values = sheet.Cells[2, 3, listItems+1, 3];
ExcelRange timeLine = sheet.Cells[2, 2, listItems+1, 2];
sheet.Cells[8, 4].Formula = "=FORECAST.ETS(" + targetDate + "," + values + "," + timeLine + ",1,1)";
sheet.Cells[8, 4].Calculate();
我想修剪
@
从excel文件中的公式,像这样:=FORECAST.ETS(B8,C2:C7,B2:B7,1,1)
最佳答案
在代码中,您不需要放置“=”字符
只需使用:
sheet.Cells[8, 4].Formula = "FORECAST.ETS(" + targetDate + "," + values + "," + timeLine + ",1,1)";
关于c# - 为什么在 EPPLUS 的 excel 公式中 = 符号后有 @ 符号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58423726/