Forum Discussion

big_smile's avatar
big_smile
Copper Contributor
Oct 15, 2023
Solved

Excel: How to strip out all non-alphanumerical characters excluding spaces.

Hi  I need to create an Excel formula that will strip out all non-alphanumerical characters excluding spaces.    Example: Before formula: This message, that is sent to you, “Mr Dog 1” : it’s said...
  • HansVogelaar's avatar
    Oct 15, 2023

    big_smile 

    The following will keep a-z, A-Z, 0-9 and spaces.

    It will not keep letters with accents such as é or ü.

     

    =LET(chars, MID(A1, SEQUENCE(LEN(A1)), 1), keep, IF((chars=" ")+(chars>="0")*(chars<="9")+(chars>="A")*(chars<="Z")+(chars>="a")*(chars<="z"), chars, ""), CONCAT(keep))

Resources