Multiple conditional branching in excel

N

NeoSwoosh

Hi All

I'm new to excel and I'm not a pro with vb either but was wondering how to do conditional branching for instance if I would like to have 5 diffrent possibilities in a if statement instead of 2 is there a better way than growing the if statement more complicating?In Vb its the case statement what is it in excel?

Any help would be appreciated a bunch!

NeoSwoosh
 
N

Norman Jones

Hi NeoSwoosh,


One way would be to nest your IF functions, that is use each subsequent IF
as the arument for the preceding IF function.

Another way might be to use a Case statement inside a UDF.


---
Regards,
Norman



NeoSwoosh said:
Hi All

I'm new to excel and I'm not a pro with vb either but was wondering how to
do conditional branching for instance if I would like to have 5 diffrent
possibilities in a if statement instead of 2 is there a better way than
growing the if statement more complicating?In Vb its the case statement what
is it in excel?
 
M

Mac Lingo

How about using the following If Structure:

IF Test.Code THEN
Code
ELSEIF Test.Code THEN
Code
ELSEIF Test.Code THEN
Code
ELSE
Code
ENDIF
 
Top