+ Reply to Thread
Results 1 to 11 of 11

Linefeed, phone number formating

  1. #1
    Registered User
    Join Date
    06-18-2012
    Location
    Opelika, Al
    MS-Off Ver
    Excel 2007
    Posts
    5

    Linefeed, phone number formating

    Hello, I would appreciate some help here. I'm using excel 2007, I'm having trouble with two problems. 1. The phone number format that I have is: example: (334)787-7121, the format that I need is shown below. 2. I'm not sure of the linefeed command using excel 2007.


    1. Flat Text File – Full List
    The Full List in a Flat Text File has one three-digit area code, a comma, and a seven-digit telephone number per line, with a linefeed at the end of each line:
    123,4567890
    123,4567890
    123,4567890

    Any help would be greatly appreciated.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Linefeed, phone number formating

    Can't you use a Helper column with this formula?

    =MID(A1,2,3)&","&MID(A1,6,3)&MID(A1,10,4)&CHAR(10)

    where A1 is the original phone number

    CHAR(10) is linefeed character
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Linefeed, phone number formating

    Or

    =SUBSTITUTE(MID(A2,2,7),")",",")&RIGHT(A2,4)&CHAR(10)

    or

    =SUBSTITUTE(SUBSTITUTE(MID(A2,2,12),")",","),"-",)&CHAR(10)
    Last edited by Cutter; 06-18-2012 at 06:55 PM.

  4. #4
    Registered User
    Join Date
    06-18-2012
    Location
    Opelika, Al
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Linefeed, phone number formating

    Cutter, thank you for the reply this is what I'm getting back with the Substitute funtion:

    Original: (334)363-0970

    using =SUBSTITUTE(MID(A1,1,6),")",",")&RIGHT(A1,4)&CHAR(10)

    it returns 3343630970, I need it to return: 334,3630970 where in the formula do you place (,) a comma behind the area code?

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Linefeed, phone number formating

    Have a closer look at the values in the MID() function.

    I used: MID(A2,2,7)
    You used: MID(A1,1,6)

    change the 1,6 to 2,7 and you'll get the right result

    The SUBSTITUTE() function is replacing the ")" with a comma

  6. #6
    Registered User
    Join Date
    06-18-2012
    Location
    Opelika, Al
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Linefeed, phone number formating

    Cutter, when I use:
    =SUBSTITUTE(MID(A2,2,7),")",",")&RIGHT(A2,4)&CHAR(10)
    on Phone number: (334) 363 0914, the return is 34363090914

    what I'm looking for is 334,3630914 linefeed.


    Opelika 36801 (334) 363-0914 "34363090914" 45-49 F Camarata John 704 704 Avenue D Avenue D C003, 599 Residents

  7. #7
    Registered User
    Join Date
    06-18-2012
    Location
    Opelika, Al
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Linefeed, phone number formating

    Special-K

    The current Phone # format is (334)787-6060
    I need the format to read: 334,7876060
    There are over 1000 numbers and the instruction further say include linefeed comand.

    Any help that you can give I would appreciate it.

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,791

    Re: Linefeed, phone number formating

    Are you saying that the underlying value is 3347876060 but that you have formatted that cell to display as (334)787-6060 ?

    In that case you just need to apply a new Custom Format to the cell(s) using this format string:

    000","0000000

    Hope this helps.

    Pete

  9. #9
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Linefeed, phone number formating

    The formula I gave you works on phone numbers formatted as you say they are - (334)787-6060.
    The return from that format (using what I gave you) would be: 334,7876060

    It does NOT work on phone numbers formatted like this - (334) 363 0914
    For that format the formula I gave you returns this: 334, 360914
    so I don't see how you're getting: 34363090914

    Are you saying some of your phone numbers have different formats, like spaces in them?

  10. #10
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Linefeed, phone number formating

    I think you're right, Pete.

    In that case the OP would need: =TEXT(A2,"000"",""0000000")&CHAR(10)

  11. #11
    Registered User
    Join Date
    06-18-2012
    Location
    Opelika, Al
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Linefeed, phone number formating

    Pete the cell currently is : 3347876060

    I need the cell to show: 334,7876060

+ 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