+ Reply to Thread
Results 1 to 4 of 4

Formula wanted to extract the middle, not the Left and Right bits.

  1. #1
    Registered User
    Join Date
    07-24-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    13

    Formula wanted to extract the middle, not the Left and Right bits.

    Is there a simple formula that will take the contents of a cell (example ABC1234567A) and in the empty cell beside it leave just the numbers (1234567)?
    Last edited by rbion; 08-02-2012 at 03:23 PM.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Formula wanted to extract the middle, not the Left and Right bits.

    With
    A1: a text-number-text string.....example: ABC9701.23ZXR
    This regular formula pulls the first series of consecutive numbers (including decimals) from that string
    B1: =LOOKUP(99^99,--MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),ROW(INDIRECT("1:"&LEN(A1)))))

    In that example, the formula returns: 9701.23

    Note: that formula can only recognize numbers that are 15 characters or less. If you need more, there's another approach.

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    07-24-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Formula wanted to extract the middle, not the Left and Right bits.

    Thank you Ron, not only did it work, but you have now given me some homework tonight (to look up and learn about each component in that formula, there are many parts in that line I haven't seen before). Very much appreciated.

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Formula wanted to extract the middle, not the Left and Right bits.

    I'm glad I could help.
    If you have questions about the structure, just ask.

+ 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