+ Reply to Thread
Results 1 to 4 of 4

Split Number into Four Separate Parts

  1. #1
    Forum Contributor
    Join Date
    09-19-2004
    Location
    Canada
    Posts
    408

    Question Split Number into Four Separate Parts

    Hi,

    I am attempting to clean up / modify a large list of twenty-digit ID numbers that should be in the format:

    2-digit number (hyphen) 6-digit number (hyphen) 10-digit number (hyphen) 2-digit number – all together, without any space.

    For example:

    99-123456-1111111111-00

    However, a number of IDs appear as:

    99-123456-1111111111-

    99-123456-111111111-

    99-123456-111111111-00

    99-123456-111111-twenty

    99-123456-1111111111

    99-123456-1111111111-00-&22

    99-123456-1111111111-22 new

    I want to split the different part into four separate columns.

    I used the following formulas (which result in a number of errors):

    =Left(A1,2)

    =Right(Left(A1,9),6)

    =Left(Right((A1,13),10)

    =Right(A1,2)

    Can anyone suggest some better formulas?

    Thank you,
    Gos-C
    Using Excel 2010 & Windows 10
    "It is better to be prepared for an opportunity and not have one than to have an opportunity and not be prepared."

  2. #2
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    Use Data>Text To Columns. On the first screen, select "Delimited", click Next. On the second screen, set the delimiters as Space and in Other, enter a dash (-); click Next. On the third screen, in the Data preview section, note the column headers all say General. Click on each in turn and click "Text" in the Column Data Format box. Use Destination to select your output range (you only need to select the upper left cell of your destination) then click Finish.

    Your data is now broken into separate columns.

    HTH

    Bruce
    Last edited by swatsp0p; 05-16-2005 at 11:48 AM. Reason: additional information...
    Bruce
    The older I get, the better I used to be.
    USA

  3. #3
    Forum Contributor
    Join Date
    09-19-2004
    Location
    Canada
    Posts
    408

    Thumbs up

    Thanks, Bruce. Works fine! (Well, the older I get, the more I learn.)

    Gos-C

  4. #4
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    I'm glad it worked for you. Thanks for the feedback, it is always appreciated.

    (You should have seen me <then>)



    Bruce

+ 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