Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

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

 

 

4 REPLIES 4
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.

Labels