+ Reply to Thread
Results 1 to 12 of 12

Formula: Change multiple Phone #'s to correct format

  1. #1
    Registered User
    Join Date
    05-23-2011
    Location
    Kentucky
    MS-Off Ver
    Excel 2010
    Posts
    20

    Smile Formula: Change multiple Phone #'s to correct format

    I have a LOT of phone numbers (A1:A1000) I need formatted the same using a formula in the row to the right (B1:B1000), is it possible?

    The problem is that there are several variations of the phone numbers in the column.

    1) "###-###-####"
    2) "(###)###-####"
    3) "###-####"
    4) "##########"
    5) "(###)-###-####)"

    Examples of above:

    A1) 704-555-5555
    A2) (704)234-2343
    A3) 445-2343
    A4) 7044343333
    A5) (704)-434-4444

    I'd like to have each one look like this: (704) 444-4444. or (###) ###-####. If the number is only 7 digits because the area code is missing, I want it to automatically add 704 to the beginning.

    My goal is to make Column B look like this:

    B1) (704) 555-5555
    B2) (704) 234-2343
    B3) (704) 445-2343
    B4) (704) 434-3333
    B5) (704) 434-4444

    Is there a simple way to use a formula for this instead of a macro? The data frequently changes in Column A so copying/pasting isn't an option.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,375

    Re: Formula: Change multiple Phone #'s to correct format

    Hi Jeff,

    If you could attach a sample file with a variety of phone number formats, we can give youj better advice.

    To attach a sample, click on Go Advanced below the message area and then on the Paper Clip Icon above the advanced message area.

    It seems to me a average formula (no vba needed) can clean up you phone numbers. I'd replace all the ( or ) with blanks. I'd also append the 704 to all that had length less than 10. Then after they were all simple numbers I'd display in the phone number format of your choice.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,058

    Re: Formula: Change multiple Phone #'s to correct format

    Here, try this:
    Attached Files Attached Files
    Never use Merged Cells in Excel

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,375

    Re: Formula: Change multiple Phone #'s to correct format

    Hi zbor,

    Did I ever say I used to test software.

    See if you handle the attached examples correctly.
    Attached Files Attached Files

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,058

    Re: Formula: Change multiple Phone #'s to correct format

    Maybe you did but I didn't notice

    Well, I didn't say it cover all examples. Just those user writed.

  6. #6
    Registered User
    Join Date
    05-23-2011
    Location
    Kentucky
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Formula: Change multiple Phone #'s to correct format

    Quote Originally Posted by zbor View Post
    Here, try this:

    =TEXT(RIGHT(SUBSTITUTE(A2,"-",""),7),"(704) "&"000"&"-"&"0000")
    That worked GREAT! Mostly...

    One thing it did was change ALL area codes to 704. I only want those without one already to have it added automatically, not change those already there.

    After seeing the clean data, i realized I also missed one format: ### ### #### (Basically, no separators at all) Can you modify it to work with this one too? 704 444 4444 is an example

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,058

    Re: Formula: Change multiple Phone #'s to correct format

    that will slightly complicate thing:
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    05-23-2011
    Location
    Kentucky
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Formula: Change multiple Phone #'s to correct format

    Quote Originally Posted by zbor View Post
    that will slightly complicate thing:
    The area code thing is working great now thanks. Last thing is to change the final format which didn't seem to get fixed in this last string you sent which was:

    =IF(LEN(A2)<10,TEXT(RIGHT(SUBSTITUTE(A2,"-",""),7),"(704) "&"000 0000"),TEXT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"-",""),"(",""),")",""),"("&"000"&") "&"000 0000"))

    I need to change 704 333 3333 to (704) 333-3333

  9. #9
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,058

    Re: Formula: Change multiple Phone #'s to correct format

    With - or without?

    Need to add one more substitute to remove space.
    Also, can there be any other telephone number different than 7 digits?

    =IF(LEN(A2)<10,TEXT(RIGHT(SUBSTITUTE(A2,"-",""),7),"(704) "&"000 0000"),TEXT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"-",""),"(",""),")","")," ",""),"("&"000"&") "&"000 0000"))

    and

    =IF(LEN(A2)<10,TEXT(RIGHT(SUBSTITUTE(A2,"-",""),7),"(704) "&"000 0000"),TEXT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"-",""),"(",""),")","")," ",""),"("&"000"&") "&"000"&"-"&"0000")) for a minus sign

  10. #10
    Registered User
    Join Date
    05-23-2011
    Location
    Kentucky
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Formula: Change multiple Phone #'s to correct format

    PERFECT. I love this forum! thanks a lot.
    Last edited by shg; 09-11-2011 at 04:55 PM. Reason: deleted quote

  11. #11
    Registered User
    Join Date
    05-23-2011
    Location
    Kentucky
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Formula: Change multiple Phone #'s to correct format

    Do me the favor or replying to my post twice so I can be your 5,000th customer

  12. #12
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,058

    Re: Formula: Change multiple Phone #'s to correct format

    Too late

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1