Google Sheets: How to perform multiple operations where the IF statement is true?

by Niaz Ahamed   Last Updated July 18, 2018 05:03 AM

The function below is what I use to handle contact information (email/phone numbers). If the entry is an email id (has text), it will keep it as is. When a phone number is entered, it does a variety of things to it.

=IF(ISNUMBER(E2), IF(LEFT(E2, 2) = "44", REPLACE(E2,1,2,"0"), CONCAT("0",E2)), E2)

I am trying to add the code/function below to the phone number, before GoogleSheets applies the above formula.

=REGEXREPLACE(TEXT(E2,"##############"),"\D","")

Basically, if cell E2 is a number, then I want to REGEXREPLACE that number first, and then perform the additional operations. I'm not sure how to join the two formulas.

Tags : google-sheets


Related Questions



Copying values between google sheets

Updated July 26, 2018 21:03 PM