+ Reply to Thread
Results 1 to 6 of 6

Formatting phone numbers

  1. #1
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Formatting phone numbers

    Hi dear gurus and contributors
    I've got a set of numbers like 0302568974025. All about more than 1000. I have to convert them into (xxx) xxx - xx - xx (Ext: xxx). But I cannot figure out how to do that. For eaxmple

    In A1: 0502567899256
    The first 3 numbers are mobile operator code, and always start from 0. So first number is always 0. Then 5 numbers are phone number. Last 3 numbers is external number of a person. The problem is that the external number can be 3 or 4 digits. So some phone numbers are 13, some are 14 digits long.

    0502567899256 >>>>>>>> (050) 256 - 78 - 99 (ext: 256)
    07745578941256>>>>>>>>(077) 455 - 78 - 94 (ext: 1256)

    Hope I you understood me. I don't want to use any formula or VBA code. I need just convert them. All values are stored as numbers.
    Last edited by contaminated; 06-23-2011 at 04:06 PM.
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Formatting phone numbers

    Format as

    [>1000000000000](000) 000-00-00 (\Ext\: 0000);[>1](000) 000-00-00 (\Ext\: 000)
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    12-24-2006
    Posts
    32

    Re: Formatting phone numbers

    this should work
    ="("&LEFT(A1,3)&" ) "&TEXT(MID(A1,4,7),"000-00-00")&" ext "&MID(A1,10,LEN(A1)-10)

  4. #4
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Formatting phone numbers

    Shg You've been told this millions and millions time of course... but you are real GENIUS!!!!!! Thanks for help... LIKE LIKE LIKE LIKE!!!!!!!!!!!!!
    James_SF thank you too, but as I told I didn't want to use any formula....Thanks anyway)))

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Formatting phone numbers

    Numberformat: (000)-000-00-00-xt.(000)



  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Formatting phone numbers

    I'm guessing you didn't actually try that format on the examples, snb ...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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