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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Using IF function with 2 parameters

Thread ID:

Created:

Updated:

Platform:

Replies:

74455 Jun 13,2008 03:46 PM UTC Jun 14,2008 06:51 PM UTC WinForms 1
loading
Tags: Calculate
Nikhil Desai
Asked On June 13, 2008 03:46 PM UTC

Like Excel, it is possible to use the IF function with only 2 parameters instead of 3.
For example:

1 + IF(1 = 1, 1) --> This returns 1

When used in an expression like above, it does not throw an error but just returns 0 regardless of the condition being true or false. However, when used on it's own it throws an exception such as

IF (1 = 1, 1) --> This throws an exception

Is there anyway we can force the calculation engine to throw an error instead of just returning a 0 for the incorrect part of the expression?



Administrator [Syncfusion]
Replied On June 14, 2008 06:51 PM UTC

Thank you for reporting this problem. We will correct it in our library code.

For now until there is a build with it corrected, you can work around the issue by swapping out the IF calculation used by the CalcEngine. Here is a minimal sample showing how you might do this.
http://www.syncfusion.com/support/user/uploads/Formula-If_problem-841192875.zip



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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon

;