IF() expression causes ArgumentException

Hi, I''m currently implementing some report generation code for our company extranet, and hit a snag with a certain formula. dataCell.Formula = "IF(B4=0;0;C4/B4)"; I''m actually building the formula programmatically but even this literal form causes the following exception: System.ArgumentOutOfRangeException IF(B4=0;0;C4/B4) Parameter name: Argument count must be 2 or 3" I''m no Excel expert really, but it looks like there are three arguments. Also, if I paste the formula in Excel, it works fine. I''ve been using simple formulas like "C4/B4" without problem. Is this an issue with the formula validation in ExcelRW, or am I missing something?

3 Replies

Carl Ådahl May 3, 2005 08:56 AM UTC

Forgot to mention that I''m using the latest (3.2.1.0) version of ExcelRW.


Carl Ådahl May 3, 2005 08:56 AM UTC

Forgot to mention that I''m using the latest (3.2.1.0) version of ExcelRW.


AD Administrator Syncfusion Team May 3, 2005 05:56 PM UTC

Hi Carl, Please replace the ; with , example, mySheet.Range["A1"].Formula = "IF(B4=0,0,C4/B4)"; Thanks, Stephen.

Loader.
Up arrow icon