Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Jun 2005
    Posts
    391
    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,663
    Thanks
    390
    Thanked 1,510 Times in 1,371 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
    391
    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,509
    Thanks
    34
    Thanked 66 Times in 62 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,752
    Thanks
    129
    Thanked 691 Times in 627 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,298
    Thanks
    3
    Thanked 202 Times in 187 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,124
    Thanks
    149
    Thanked 571 Times in 543 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
  •