Help

Need help with Substitute/If

685 3
cancel
Showing results for 
Search instead for 
Did you mean: 
Fabian_Boudin
4 - Data Explorer
4 - Data Explorer

Hello people, hope you can help me to solve my problem.

I’m currently using a formula to substitute some character for cleaning my cell :

SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(Telephone,".","")," “,”"),"-",""),"(",""),")","")

and after this step , i’m using an other formula :

IF(LEFT(Telephone,1)!=“0”,CONCATENATE(“0”,Telephone),Telephone)

it works perfectly but the question is : how can i do the same thing in one formula ?

For exemple :

(06-07-45)43.56 26 i want 060745435626
(6-07-45)43.56 26 i want 060745435626

Sorry for my english, i’m french :grinning_face_with_smiling_eyes: and thank you for your answers.

3 Replies 3

Simplify your formula by using REGEX to remove “everything that’s not a digit” ([^\\d])

IF(
   LEFT(REGEX_REPLACE(Telephone, "[^\\d]", ""), 1) != "0",
   "0"
) & REGEX_REPLACE(Telephone, "[^\\d]", "")

^ the above could probably be written more efficiently with a single line of REGEX, but the above will work.

Fabian_Boudin
4 - Data Explorer
4 - Data Explorer

It’s perfect ! Thank you a lot !

thanks my issue has been fixed.