+ Reply to Thread
Results 1 to 6 of 6

Unable to pull numbers (variable lengths and periods) out of cells

  1. #1
    Registered User
    Join Date
    07-18-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    48

    Unable to pull numbers (variable lengths and periods) out of cells

    Good Morning,

    I have a filed that is imported into excel from another database. It imports with number headings in the same cell as the text. I would like to be able to pull the numbers out of the text cells and place them in column A. I have attempted to use the Mid, Left and Text to Columns methods, but the numbers are different lengths and have Periods (.) within them as well. Also, there are some Rows that do not contain any numbers, so I would want to leave them as is. I am sure that I am missing something easy, but I can't figure it out.

    I have attached a sample workbook for viewing.

    Here is a quick example of what appears in Column A when the file is imported:

    23.********** Review and analyze current and deferred tax assets and liabilities
    23.1.2************* Analysis of current and deferred income tax asset and liability accounts for each of last three years and most recent interim period, including any provisions made for aggressive filing positions and tax audit issues


    Thank you in advance for your help.
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,495

    Re: Unable to pull numbers (variable lengths and periods) out of cells

    =TRIM(SUBSTITUTE(LEFT(B1,FIND(" ",B1)),CHAR(160),""))


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    07-18-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Unable to pull numbers (variable lengths and periods) out of cells

    Thank you TMS! That is great! that works awesome.

    Is there a way to "delete" those numbers from the cell that its pulling them from? So, only the text is left in the original cell?

    Thanks again for your quick help... much appreciated!

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,495

    Re: Unable to pull numbers (variable lengths and periods) out of cells

    Depends how you want it to look. There are a lot of non-printable characters in there (160), hence the SUBSTITUTE. The good news is there is a space after them. And you can't replace the text directly without using VBA. You can, however, use a Helper column and then Copy and Paste Special | Values.

    So, in a helper column:

    =MID(B1,FIND(" ",B1)+1, LEN(B1))


    Regards, TMS



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  5. #5
    Registered User
    Join Date
    07-18-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Unable to pull numbers (variable lengths and periods) out of cells

    Thats great! Thank you again for your help!

    have a great day

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,495

    Re: Unable to pull numbers (variable lengths and periods) out of cells

    You're welcome. Thanks for the rep.

+ 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