+ Reply to Thread
Results 1 to 10 of 10

extracting numbers between text

  1. #1
    Registered User
    Join Date
    07-24-2015
    Location
    Horsham
    MS-Off Ver
    2007
    Posts
    2

    extracting numbers between text

    Hi, new to this forum. I have been looking for a solution to this problem for sometime but cannot ever seem to get anything that works. So thought I would just post it here and see if anyone can help me. Thanks in advance.

    I am trying to extract numbers from a string between the letter x. So if column A was the input, B, C and D would be the corresponding outputs.

    A B C D
    1 90x90x7 90 90 7
    2 120x90x8 120 90 8
    3 150x150x12 150 150 12


    I know of the deliminator function does this, however I cant use this and I am looking for formulas that would work in its place.

    Cheers.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: extracting numbers between text

    Try this...

    Data Range
    A
    B
    C
    D
    1
    ------
    ------
    ------
    ------
    2
    90x90x7
    90
    90
    7
    3
    120x90x8
    120
    90
    8
    4
    150x150x12
    150
    150
    12


    This formula entered in B2 and copied across to D2:

    =--TRIM(MID(SUBSTITUTE("x"&$A2,"x",REPT(" ",255)),COLUMNS($B2:B2)*255,255))

    Assumes no numbers start with leading zeros.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: extracting numbers between text

    Use this formula in B1 and pull it to the right until you see blanks and then down

    =--TRIM(MID(SUBSTITUTE("x"&$A1,"x",REPT(" ",50)),50*COLUMNS($A:A),50))

    Row\Col
    A
    B
    C
    D
    1
    90x90x7 90 90 7
    2
    120x90x8 120 90 8
    3
    150x150x12 150 150 12
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    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: extracting numbers between text

    Hi, welcome to the forum

    Assuming your data starts in row 2...
    =--TRIM(MID(SUBSTITUTE($A2,"x",REPT(" ",LEN($A2))),LEN($A2)*(COLUMN()-2)+1,LEN($A2)))
    copied down
    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

  5. #5
    Registered User
    Join Date
    07-24-2015
    Location
    Horsham
    MS-Off Ver
    2007
    Posts
    2

    Re: extracting numbers between text

    that works perfectly. Thank you

  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,085

    Re: extracting numbers between text

    Hell of an echo (echo, echo, echo, ...) on this one
    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


  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: extracting numbers between text

    You're welcome. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: extracting numbers between text

    No echo here

    With the built in Text to column and use X as seperator.

    See the attached file.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  9. #9
    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,085

    Re: extracting numbers between text

    @oeldere: the OP said ...


    I know of the deliminator function does this, however I cant use this and I am looking for formulas that would work in its place.

  10. #10
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: extracting numbers between text

    @TMS
    Please Login or Register  to view this content.
    It can be used, since the result is the same.

    Some members think that the delimited result comes in the place of the original data.

    But you can select another cell, in this case B1. (see the attached file in #8).

    If this is not the case, I would like to know from the OP, why it can't be used.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Extracting text and numbers
    By pauldaddyadams in forum Excel General
    Replies: 6
    Last Post: 11-19-2014, 08:50 AM
  2. [SOLVED] Extracting numbers from text?
    By shiftyspina in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-15-2014, 11:10 AM
  3. [SOLVED] Extracting Numbers from Text
    By KCHCEXCELME in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-09-2013, 11:38 AM
  4. [SOLVED] extracting numbers from a string of text and numbers
    By ScottLor in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-05-2013, 04:47 PM
  5. Extracting numbers and text from inconsistent text/number formatted string
    By Brandivil in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-25-2013, 01:46 PM
  6. [SOLVED] Extracting Numbers from text
    By hoventim in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 12-11-2012, 09:08 AM
  7. Replies: 17
    Last Post: 03-03-2010, 06:55 PM

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