We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

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 03:56 AM

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


Carl Ådahl May 3, 2005 03:56 AM

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


AD Administrator Syncfusion Team May 3, 2005 12:56 PM

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

Loader.
Live Chat Icon For mobile
Up arrow icon