In excel or google sheets, is there an 'if' function equivalent to the sql 'when A in (X,Y,Z). Currently I use: if(and(A=X, A=Y, A=Z), then, else). Wondering if there is an: if(in(X,Y,Z)=A, then, else).
Thanks
Just updating the answers Here slightly, for Excel and Google Sheets
=IF(OR(A1={1,2,3,4,5}),"Yes","No")
or
=IF(ISNUMBER(MATCH(A1,{1,2,3,4,5},0)),"Yes","No")
For Open Office
=IF(OR(A1={1;2;3;4;5});"Yes";"No")
or
=IF(ISNUMBER(MATCH(A1;{1;2;3;4;5};0));"Yes";"No")
If(IsError(Match(A, {X,Y,Z},0)), else, then)