Phone number formatting

We are collecting leads in Google sheet via multiple channels.

Phone number format is different for some leads, for example
9876543210
98765 43310 ( Space is there)
919876543210 ( Country code is there)

We are looking to have only 10 digits number numbers
987654321

How to do it, please advise.

I think you need to have a specific category to give the right treatment to each category.

For the second one, use a substitute formula in the sheet to replace the blank space by a null character.

For the third one, to keep it in the editor, maybe you can try dividing by 10^10, then use a template column and math column to take the first two numbers as a new value (basically trying to take the first 2 numbers out), then take the original number minus new value*10^10 to take the final 10 numbers. Be careful with rounding up.

In excel and Google sheet, we use formula following formula
=Right( A1, 10) and this gives us last 10 digits from right to left.
Can we do something like this in here.

@Adviuz I’m all for data being clean, but silly question: does it matter if your phone numbers have spaces in them? Does your phone button component work with and without spaces?

Be careful with setting min. and max. value for your country codes and phone numbers (and zip codes and anything else). We’ve all experienced forms online where we enter our valid data and the form returns an error. A classic case of product teams trying to be smart rather than pragmatic?