Switch case | Excel Cell Contain

Hi guys,

I would like to use Switch Case depending on a part of an excel Cell, is it something possible?
Switch Column B
Case 1 contains “SOS” put 1
Case 2 contains “PET” put 2

Thank you


Check this out

It iterates through a range and based on the content found in the range it prints different things :slight_smile:

For further reference regarding the switch activity please refer to the official documentation


Hi Dragos,

Thanks for that, my question is more about the “Test” itself. How to test a part of a cell. Can I add a forumula, like left(collumn,4).
I have some Number like (SOS10T, SOS10F, PETTJ8, PETF87)
I need to do this test only on the common caractere. So part of the cell.



OK now we have a different problem altogether :slight_smile: I think the easiest way to tackle this kinds of problems ( they are all pattern matching problems) would be to use a regex , which unfortunately StudioX does not posses at the moment this capability so you are stuck with an imbricated set of if else . In the if / else activity you have the condition builder which would be helpful because it supports a few functions , such as contains , starts with ends with , etc

Hope this helps,

Generate substring from the text in excel cell. Ex: SOS10T => SOS (result of sub string)
and then pass that value into the switch case.