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
close icon

Using IF function with 2 parameters

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?



1 Reply

AD Administrator Syncfusion Team 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



Loader.
Live Chat Icon For mobile
Up arrow icon