### Post

I can’t figureout how to use the Case/If statement.

I have a calculation, which depends on different parameters. And been trying to fool around with the case statement which I can’t get working.

I’m trying to figure out how to get the following to work:

Case (Investment VAT switch = "with VAT" ; TOTAL AMOUNT;

Investment VAT switch = "without VAT" ; TOTAL AMOUNT - (TOTAL AMOUNT / 6);

Investment VAT switch = "without VAT" & VAT_noVAT = "noVAT" ; TOTAL AMOUNT)

Can get the first 2 cases to work, but the last one is giving me the result TOTAL AMOUNT - (TOTAL AMOUNT / 6); how do I use multiply parameters..?

I should have noticed that detail sooner.

Case selects the result for the first expression to evaluate as True.

In the case of

Investment VAT switch = "without VAT" and VAT_noVAT = "noVAT"

Investment VAT switch = "without VAT"

will also be True and is evaluated first. Thus, the last Boolean expression is never evaluated. I think that was the Point to DavidAnders' post but I didn't see it either.

Rewrite the function to test for the more specific condition first:

Case (

Investment VAT switch = "with VAT" ; TOTAL AMOUNT;

Investment VAT switch = "without VAT" and VAT_noVAT = "noVAT" ; TOTAL AMOUNT ;

Investment VAT switch = "without VAT" ; TOTAL AMOUNT - (TOTAL AMOUNT / 6) )