Any on have eyes on formula to format a number? It’s a phone number column and I need all of the numbers to be in (###) ###-#### format. Any help is always appreciated.
This is great, could you help advising in how to add the country code as well?
+1
for example.
Thanks!
Hi there @Ivo_Ezeta !
Sorry to get back at you so late !
Just in case you were still wondering about this, here is how I would add Country Code +1 to this .
I’ve also added another solution if other countries are needed too .
Looking to do the opposite and remove all parenthesis. Any guesses?
Depending how the phone number is originally entered in the table (I assume it was in a Text
field here) but I’ve got this :
(The formula in Number
might need some adjustments, depending on what your phone number actually looks like )
There might be other ways to get to that result too.
For the sake of simplicity, to “de-pattern” numbers there is an even easier solution:
[Formatted Number].RegexReplace("[^0-9]", "")
Which - literally - takes out every non number char.
As a hint, every time there is some string manipulation, take into consideration that RegexpMatch()
and RegexpReplace()
are very powerful and (usually) more efficient.
The drawback is to learn a bit of their syntax, but it worths doing it in the long term.
Thanks Frederico ! I’m gonna add this to the doc I shared .
I thought about using Regex but I didn’t had the time to look there .
(I’ve played around with RegexMatch()
and RegexReplace()
in the past, and I fully agree with you here about the efficiency, but it was some time ago and I didn’t got the chance, yet, to explore those formulas again )