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.
Unfortunately, activation email could not send to your email. Please try again.

IF() expression causes ArgumentException

Thread ID:

Created:

Updated:

Platform:

Replies:

28482 May 3,2005 04:52 AM May 3,2005 01:56 PM Windows Forms 3
loading
Tags: XlsIO
Carl Ådahl
Asked On May 3, 2005 04:52 AM

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?

Carl Ådahl
Replied On May 3, 2005 04:56 AM

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

Carl Ådahl
Replied On May 3, 2005 04:56 AM

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

Administrator [Syncfusion]
Replied On May 3, 2005 01:56 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;