Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    Jun 2005
    Posts
    403
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Extracting specific characters (numbers) within a cell

    I would like to pull out the numbers after the 'SEQ' some are 1 digit and others are more. I highlighted the column with the numbers i would like to extract.

    Can this be accomplished??
    Attached Files Attached Files

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,950
    Thanks
    421
    Thanked 1,605 Times in 1,449 Posts
    MNN,

    Here's a User Defined Function that will do the trick:
    Limitation: there must be at least one space on either side of the number!

    Code:
    Option Explicit
    
    Function ExtSeqNo(ByVal zText As String) As Long
    
        Dim vParts As Variant
        
        zText = Replace(zText, "  ", " ")
        vParts = Split(zText, " ")
        ExtSeqNo = vParts(1)
        
    End Function  'ExtSeqNo
    Test Results:
    MnnUDF.PNG

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    4 Star Lounger
    Join Date
    Jun 2005
    Posts
    403
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Any way of accomplishing this without a MACRO.

    Thanks

  4. #4
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    La Jolla, CA
    Posts
    1,575
    Thanks
    44
    Thanked 73 Times in 69 Posts
    Fill this down (but fix line 17 to remove the add'l space after SEQ so there's only 1 space):

    =MID(B3,FIND(" ",B3)+1,FIND(" ",B3,FIND(" ",B3)+1)-FIND(" ",B3))

  5. #5
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,978
    Thanks
    156
    Thanked 769 Times in 701 Posts
    Another formula that will work:

    =LEFT(REPLACE(B3,1,4,""),FIND(" ",REPLACE(B3,1,4,""),1)) then copy down. As KW points out, there is an extra space in B17.

    Maud

  6. #6
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,347
    Thanks
    3
    Thanked 226 Times in 209 Posts
    As an alternative:
    =-LOOKUP(1,-(LEFT(MID(B3,FIND(" ",B3),LEN(B3)),ROW($1:$255))+0))
    which works with all your examples.
    Last edited by rory; 2016-05-12 at 02:29.
    Regards,
    Rory

    Microsoft MVP - Excel

  7. #7
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    3,410
    Thanks
    164
    Thanked 639 Times in 607 Posts
    I like all the answers.

    Here's my version:
    =--MID(B3,4,SEARCH(" ",B3,6)-4)
    ..then copy down etc etc

    zeddy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •