+ Reply to Thread
Results 1 to 3 of 3

Insert hyphens in number or letter strings

  1. #1
    Registered User
    Join Date
    10-16-2007
    Posts
    8

    Insert hyphens in number or letter strings

    Is there a formula similar to the "Replace" one that could insert hyphens in a serie of numbers.
    Explain: I acquire data from a site on the Internet in the format of a spreadsheet. Columns are filled with strings of numbers and or characters like:11001446521. I need to change it to 110-0144652-1.
    Is there a formula that can perform this change?

    TKS

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    If your data is consistent and the results you want are consistent (i.e. the dashes are always in the same places), then try:

    =LEFT(A2,3)&"-"&MID(A2,4,7)&"-"&RIGHT(A2)

    where A2 contains string to convert. Then copy formula down.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    10-16-2007
    Posts
    8

    Tested the formula

    Quote Originally Posted by NBVC
    If your data is consistent and the results you want are consistent (i.e. the dashes are always in the same places), then try:

    =LEFT(A2,3)&"-"&MID(A2,4,7)&"-"&RIGHT(A2)

    where A2 contains string to convert. Then copy formula down.
    [QUOTE=excelhlp]Works fine as long as you finish with (A2,2). Want to thank the issuer of the reply. Without help I couldn't have finished writing the formula.

+ 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