> For the complete documentation index, see [llms.txt](https://help.auxalia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.auxalia.com/plant-tools/plantexpresstools/how-to-use/calculations/additional-functions/ptswitchcase-ptswitchcondition.md).

# PTSwitchCase & PTSwitchCondition

The two Switch functions are useful when having a lot of different conditions and the use of **IIF** would just be too long.

### <mark style="color:blue;">PTSwitchCase</mark>

With PTSwitchCase you use one property and then you define the case and the return value. You repeat this for all your cases. At the end you define a default value for the case if nothing applies.

![](/files/bEWaZeCM4TuzizV51hkM)

When selecting **New** the return value is 1.

![](/files/YSJ0yb7TOwNHbEhi0133)

### <mark style="color:blue;">PTSwitchCondition</mark>

PTSwitchCondition is more flexible. Although, the example below is using the same use case as PTSwitchCase above.

You define a condition and a return value if the condition applies. As soon as the first condition applies, this is the return value you will get. Like with PTSwitchCase above, if no condition applies, the default value at the end will be returned.

![](/files/RgSQcuhQrdHpGTfI5PCL)

Here we have the same result as with PTSwitchCase.

![](/files/YSJ0yb7TOwNHbEhi0133)
