You don't need a script.
A calculation field will do.
Solution 2.
You want the format to be (XXX) XXX-XXXX, but you have entered (or imported) the data in ALL KINDS of different ways:
111 555-1212
(111) 555-1212
111.555.1212
Here’s what you do:
1. Choose “Define Fields...” from the “Select” menu and create a new CALCULATION field called “Phone Numbers Only” (WITHOUT the quotes!). The calculation is very simple, just type in the name of the phone number field, in our case “Phone”. MAKE SURE the “Calculation result” is set to “NUMBER” and click OK.
2. Create ANOTHER calculation field called “Formatted Phone” and enter the following calculation:
MAKE SURE the “Calculation result” is set to “TEXT” and click OK.
That’s it! The first calculation “Phone Numbers Only” will strip out ALL text characters from the phone number (because we set it’s type to NUMBER). So a phone number that is formatted as “% 111###...555,,,1212” will have just the numbers: 1115551212. From there, we take the first three numbers (using the “Left” function) surround them with parenthesis (note the space after the second parenthesis), take the next 3 characters (using the “Middle” function), put a hyphen between them, then take the last 4 characters (using the “Right” function).
"Too Many Digits", "Too Many Digits", "Too Many Digits", "Too Many Digits", "Too Many Digits", "Too Many Digits", "Too Many Digits", "Too Many Digits", "Too Many Digits"Choose(
"Too Many Digits", "Too Many Digits", "Too Many Digits", "Too Many Digits", "Too Many Digits", "Too Many Digits", "Too Many Digits", "Too Many Digits", "Too Many Digits"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.