This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I wanted to point out that if the case of the letter "S" is important, the solutions from @Claje handle case differently.
In the first example, the RIGHT() syntax is case-sensitive so the replacement will only work with an uppercase "S". To make the RIGHT() syntax example case-insensitive, you could:
IF RIGHT([Last Name]),1) = "S" OR RIGHT([Last Name),1) = "s" THEN "Cookies" ELSE [Category] ENDIF
IF RIGHT(UPPERCASE([Last Name]),1) = "S" THEN "Cookies" ELSE [Category] ENDIF
In the second example, the ENDSWITH() syntax defaults to being case-insensitive, therefore, as written both 'S' and 's' would become "Cookies". If case is important, you could add the third parameter to the ENDSWITH() function:
IF ENDSWITH([Last Name],"S",0)