Ravindra BagaleCourses & study guides

5. Data Cleaning A–Z

5.14 Removing Unwanted Characters

Before

Product (raw)
*Nashik Grapes* 500 g
Poha #1 kg
Ladi Pav (6 pcs)!!
Amul_Butter_100_g

After

Product
Nashik Grapes 500 g
Poha 1 kg
Ladi Pav (6 pcs)
Amul Butter 100 g

Steps in Excel

  1. Several characters with nested SUBSTITUTE: =TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"*",""),"#",""),"!",""),"_"," ")).
  2. Find & Replace for one character at a time. To find a literal * or ?, type ~* or ~? (the tilde escapes the wildcard).
  3. Microsoft 365 – remove a list of characters with REDUCE/LAMBDA (advanced, optional):

    =TRIM(REDUCE(A2,{"*","#","!"},LAMBDA(t,c,SUBSTITUTE(t,c,""))))

Ravindra Bagale's Tip

When searching for * in Find & Replace, many students end up with a whole empty column – because * means "anything" (a wildcard). For a literal star, write ~*. Before Replace All, use Find All to see how many cells are found, then replace.

Practice task

Clean 10 product names containing *, #, _, !! and double spaces. Do it once with Find & Replace (using ~*) and once with a SUBSTITUTE formula.