Based on this question, I'd like the following
\newcommand{\word}{Paul}
\newcommand{\butnot}{Joe}
\IfStringInList{\word}{George,John,Paul,Ringo}{Beat it}{Roll it}
\IfStringInList{\butnot}{George,John,Paul,Ringo}{Beat it}{Roll it}
to return Beat it
and Roll it
.
This has in principle been answered here but only with the help of 2 packages. It should, however, be possible much simpler with the solution here, only that I couldn't figure out how to expand the macro? (Not even with the help of this reference :/ )