Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Jun 2005
    Posts
    388
    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,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 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
    3 Star Lounger
    Join Date
    Jun 2005
    Posts
    388
    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,470
    Thanks
    30
    Thanked 62 Times in 58 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,640
    Thanks
    115
    Thanked 651 Times in 593 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,280
    Thanks
    3
    Thanked 191 Times in 177 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 03:29.
    Regards,
    Rory

    Microsoft MVP - Excel

  7. #7
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,832
    Thanks
    136
    Thanked 484 Times in 461 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
  •