1
votes

I'm trying to use the SUMIF formula in Excel using C#. 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.

Thanks a lot!

1

1 Answers

2
votes

Try =SUMIF(Sheet1!A:A,A1,Sheet1!B:B). The argument delimiter should be a comma, not a semicolon.