Page 1 of 1

multiple IF THEN ELSE equatios

Posted: Wed Feb 06, 2013 9:53 am
by oludot5
Hi
I am wondering how to combine multiple "IF THEN ELSE " statements in the same equation.i.e. how to I represent in a single equation 3 or 4 conditions of a statement with he same IF THEN ELSE equation?

Re: multiple IF THEN ELSE equatios

Posted: Wed Feb 06, 2013 10:45 am
by Administrator
I would try to avoid it where possible as it can make things tricky to debug.

There are two ways. Either embed them

Code: Select all

result = IF THEN ELSE ( a > b , c , IF THEN ELSE ( a > d , e, 0 ) )
or add them (this is my preferred option as I find it clearer).

Code: Select all

result = IF THEN ELSE ( a > b , c , 0 )
+ IF THEN ELSE ( a > d , e , 0 ) )

Re: multiple IF THEN ELSE equatios

Posted: Wed Feb 06, 2013 11:16 am
by oludot5
many thanks