+ Reply to Thread
Results 1 to 3 of 3

Return Text from string containing both text and numbers left and right

  1. #1
    Registered User
    Join Date
    10-23-2012
    Location
    Mount Lambert, Trinidad and Tobago
    MS-Off Ver
    Excel 2010
    Posts
    1

    Question Return Text from string containing both text and numbers left and right

    Hello,

    I have a very long list of items that from which i would like to have the text and numbers separated. Here are a few examples:
    00001 2X2 ACR/DIFFUSER 5.00 20.00 20.00 19.55
    00001-A 2X2 EGGCRATE DIFF 39.95 39.95 51.95
    00002 2X4 ACR H/DOOR DIFFUSER 198.00 35.00 35.00 45.00
    00002-A 2X4 DIFF W/FRAME 145.00 145.00 120.00

    Basically, the numbers to the right are prices. Some of the strings contain 3 prices and some contain 4. The numbers to the left are just the item numbers and they are all the same length. Some of the items themselves contain numbers in their names (e.g. 2x2) and I would like to keep these numbers in the result.

    I read some older posts but i could not find one that solved this problem exactly.

    I would really appreciate the assistance.

    Thanks in advance,

    LorinL

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Return Text from string containing both text and numbers left and right

    Assuming data is starts in A2...

    then in B2 enter:

    =TRIM(MID(SUBSTITUTE($A2," ",REPT(" ",100)),1+(100*(COLUMNS($A$1:A$1)-1)),100))

    copied to C2 and then down the list

    in D2 enter:

    =TRIM(MID(A2,LEN(B2&C2)+2,MIN(FIND(0,SUBSTITUTE(MID(A2,LEN(B2&C2)+2,255),{1,2,3,4,5,6,7,8,9},0)&0))-1))

    copied down

    in E2 enter:

    =IFERROR(TRIM(MID(SUBSTITUTE(TRIM(MID($A2,LEN(B2&C2&D2)+3,255))," ",REPT(" ",100)),1+(100*(COLUMNS($A$1:A$1)-1)),100))+0,"")

    copied down and across number of columns equal to largest number of numeric extracts....

    you can format these columns to 2 decimal places.
    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
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Return Text from string containing both text and numbers left and right

    Please make it in a excel workbook with the expected output and attach the file for getting quick solution.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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