+ Reply to Thread
Results 1 to 5 of 5

Determine and separate numbers from a string!

  1. #1
    Registered User
    Join Date
    02-09-2013
    Location
    Perth Western Australia
    MS-Off Ver
    Excel 2003
    Posts
    2

    Smile Determine and separate numbers from a string!

    Have a schedule which has a few thousand lines like the following:

    033 Masonry
    0331 Brick and block construction
    0332 Stone masonry
    0333 Stone repair


    with number lengths varying in each string . . . but always at the beginning of the string.

    Issue:

    I want to separate the numerical values from the string and place in an adjacent column . . . . retaining the text string as is!

    calibandog

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,719

    Re: Determine and separate numbers from a string!

    Assume your data in column A. In B type =LEFT(A1,FIND(" ",A1)) and copy down.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    02-09-2013
    Location
    Perth Western Australia
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Determine and separate numbers from a string!

    alansiman

    Thank you! That was perfect for the numerical values.

    In addition, I need to remove the numerical value from the string leaving only residual text!!! ))

    Sorry . . . my request was not clear in that regard!

    Regards

    calibandog

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Determine and separate numbers from a string!

    Modifying alansidmans solution to meet your new request you could try =MID(A1,LEN(LEFT(A1,FIND(" ",A1))),LEN(A1)-LEN(LEFT(A1,FIND(" ",A1)))+1)

    Alf

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Determine and separate numbers from a string!

    or add to it....

    =SUBSTITUTE(A1,LEFT(A1,FIND(" ",A1)),"")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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