Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Phone Number format (000)000-0000

reginawhelan
8 - Asteroid

Is there a formula that would format all different types of formatted phone numbers into (000)000-0000?

 

For example: A file may have the following formats:

1231231234

123-123-1234

123123-1234

123-1231234

 

 

7 REPLIES 7
Bennel_Wilson
8 - Asteroid

Hi,

Let me know if this works.

 

Output:

 

Bennel_Wilson_0-1590432648492.png

 

 

The main part is the formula tool with this formula:

 

Bennel_Wilson_1-1590432673089.png

 

 

Attached workflow for your reference.

 

Regards

Benn

 

P.S: In case this solves your query, kindly mark it as a solution.

MarqueeCrew
20 - Arcturus
20 - Arcturus

@reginawhelan ,

 

Please try:

 

Regex_Replace([phone number],"\D*?(\d{3})\D*?(\d{3})\D*?(\d{4})",'($1)$2-$3')

 

 cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
reginawhelan
8 - Asteroid

Thank you.

bsalsbury
5 - Atom

What if you had some phone numbers that didn't have the area code populated? Maybe to get the end result to be like (000) 123-4567.

lmilimonka
6 - Meteoroid

Hi,

 

How do I apply this formula to a column called Telephone_Number.

Please let me know.

Thanks

Lesia

lmilimonka
6 - Meteoroid

In the Telephone Number I have these formats but additionally I have European Phone numbers.

1231231234

123-123-1234

+44 (0) 1234-4567-568

+39 0883 1978041

 

For the European phone numbers I need it to be +44 (0) 1234-4567-568

Let me know

lmilimonka
6 - Meteoroid

Regex_Replace([phone number],"\D*?(\d{3})\D*?(\d{3})\D*?(\d{4})",'($1)$2-$3')

How can I use this formula but the date format would be:

(000) 000-0000

Any help is appreciated.

 

Labels
Top Solution Authors