It's also possible to use nested SUBSTITUTE() functions to preserve a character in some instances but change it in others:
In cell A1 I have:
Comedy, Music, Bonus Features
In cell B1 I want:
comedy music bonus.features
One formula to achieve this is:
=LOWER(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(A1); ", "; "|"); " "; "."); "|"; " "))
The first substitution replaces a comma and space (", ") with a character not likely to be found in cell A1: "|".
The second substitution replaces all spaces with periods.
The third substitution replaces all | characters with spaces.
The order is important so that wanted spaces aren't replaced with periods.
The TRIM() function ensures that no trailing spaces in A1 are converted to periods.
Another way to achieve this with fewer steps is to use this formula:
=LOWER(SUBSTITUTE(SUBSTITUTE(TRIM(A1); " "; "."); ",."; " "))
In this case, the first substitution replaces all the spaces with periods, which results in:
comedy,.music,.bonus.features
The second substitution replaces all instances of ",."
with a space to get the desired result:
comedy music bonus.features
So, for 10 non-English characters I would need 10 nested SUBSTITUTE() calls? As I stated in the question, that's exactly what I was trying to avoid. Sorry if I missed something in your response. – user1566515 – 2013-09-16T19:52:03.900