+ Reply to Thread
Results 1 to 2 of 2

Extracting consecutive numbers from cell

  1. #1
    Registered User
    Join Date
    07-04-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    36

    Extracting consecutive numbers from cell

    Good morning,

    I am getting close but so far away from this. I have about 60,000 emails to go through and extract a service order number so I can cross reference if it exists in a database. Here is what I am looking at for the cells A1 - A11:

    HTML Code: 
    The formula I am using to extract the 7 digit number is below:
    Please Login or Register  to view this content.
    Here are the results I get from the extraction formula that resides in B1 - B11:
    HTML Code: 
    For the most part it works but there are some that end up like the third result. The issue is, I would like it to be able to find 6 or 7 consecutive digits in a row (some earlier service orders are 6 digit). Am I on the right track?

    I appreciate any help you can offer.

    Best regards,

    D

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Extracting consecutive numbers from cell

    the reason you get 41482
    is it finds 7-27 and sees that as 27/2/2013 41482 is the date code for that
    how you find number strings of a given length is a different matter
    providing your 2010 is 32 bit down load and activate the morefunc add in
    note from mrexcel forum you may have to do this
    After you have installed it on your computer, open Excel, go to the developer tab on the ribbon, click on the add-ins button and browse to where it was installed (probably C:\Program Files\MoreFunc). Add references to both Morefunc.xll and Morefunc12.xlam (do this one at a time). From there you should be up and running...
    http://en.kioskea.net/download/downl...d-in-for-excel
    then you can use
    =REGEX.MID(A1,"\b(\d{6,7})\b")
    or try this udf use as
    =extractstring(A1)
    Please Login or Register  to view this content.
    Last edited by martindwilson; 11-20-2013 at 04:37 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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. Replies: 6
    Last Post: 03-23-2012, 06:03 PM
  2. Replies: 17
    Last Post: 08-20-2009, 03:51 PM
  3. [SOLVED] Consecutive numbers in 1 cell
    By LMiller in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  4. Consecutive numbers in 1 cell
    By LMiller in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-06-2005, 05:05 PM
  5. Consecutive numbers in 1 cell
    By LMiller in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 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