Tabish
(Tabish)
May 20, 2021, 9:57am
1
Hello Experts,
I am trying to write a SWITCH formula, as below:
SWITCH({CUSTOMER NUMBER},“123”,ABC
,“456”,DEF
,“789”,GHI
,“012”,JKL
,“345”,MNO)
The customer number column is TEXT column, which is linked to a submission form. I cannot get this formula to work, I have no idea why.
I have another formula, wherein the lookup column is a dropdown menu, which works beautifully, with the same parameters
Please guide and help
mark.anley
(Green Llamas Consulting)
May 20, 2021, 10:11am
2
Hi @Tabish - you just need to have your results in quotes and this should work for you:
SWITCH({CUSTOMER NUMBER},“123”, “ABC”
,“456”, “DEF”
,“789”, “GHI”
,“012”, “JKL”
,“345”, “MNO”, “ZZZ” )
It’s also good to add a default value (I added “ZZZ”) if none of the comparisons within the statement match.
Thanks,
Mark
Tabish
(Tabish)
May 20, 2021, 10:51am
3
Hi @mark.anley
Thank you so much for your reply, I tweaked the formula to add the last default value, however now the result shows up as 123, i.e., the fist lookup values for all the rows, regardless if there is a match or not.
What am I doing wrong here?
mark.anley
(Green Llamas Consulting)
May 20, 2021, 7:26pm
4
Hi @Tabish - that seems strange. I tested the same thing in my environment and it worked perfect. Here is a screen shot just to be sure:
Let me know,
Mark
Tabish
(Tabish)
May 23, 2021, 6:16am
5
Hi @mark.anley ,
I copied and pasted your code, and it is working fine now.
I think I misplaced the coma somewhere.
Thank you so much for your help, you are a lifesaver
1 Like
mark.anley
(Green Llamas Consulting)
May 23, 2021, 3:13pm
6
You are most welcome @Tabish