0

I'm getting user submitted phone numbers in a variety of forms, for example (fictional):

(423)700-4000
9002570000
703-203-3000

I want to extract just the numbers so that I can upload them to an app that doesn't accept anything but numbers. How can I do that with a Google Sheets formula?

0

This function gets rid of all non-digit characters from cell A1 with REGEXREPLACE(). To avoid error when there's no non-digit character, the formula is wrapped with a fall-back IFERROR(). Output strings are then cast as a number with VALUE().

=VALUE(IFERROR(REGEXREPLACE(A1,"[^0-9]",""),A1)

The output for the sample from above is:

4237004000
9002570000
7032033000
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.