简体   繁体   English

SUMIF Excel公式c#未处理异常

[英]SUMIF Excel Formula c# Exception Unhandled

I'm trying to use the SUMIF formula in Excel using C#. 我正在尝试使用C#在Excel中使用SUMIF公式。 I'm using the following code: 我正在使用以下代码:

   oRng = (bSheet.Cells[row, 2] as Excel.Range);
   oRng.Formula = "=SUMIF(Sheet1!A:A;A1;Sheet1!B:B)";

This returns "Exception Unhandled" error. 这将返回“未处理的异常”错误。 In this case, I tried use another formula as simple SUM(Sheet1!A1:A3) and it worked perfectly. 在这种情况下,我尝试使用另一个公式作为简单的SUM(Sheet1!A1:A3),它运行良好。

Thanks a lot! 非常感谢!

Try =SUMIF(Sheet1!A:A,A1,Sheet1!B:B) . 尝试=SUMIF(Sheet1!A:A,A1,Sheet1!B:B) The argument delimiter should be a comma, not a semicolon. 参数定界符应为逗号,而不是分号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM