+ Reply to Thread
Results 1 to 9 of 9

Isolate string of next

Hybrid View

  1. #1
    Registered User
    Join Date
    06-18-2013
    Location
    Indianapolis
    MS-Off Ver
    Excel 2003
    Posts
    3

    Isolate string of next

    I need to isolate a string of text that at times may vary in length. The string in question is: IN.Tags.Share.handleCount({"count":2,"fCnt":"2","fCntPlusOne":"3","url":"http:\/\/relevance.com\/blog\/blog-editing-tip-use-adverbs-carfeully\/"});

    I'm interested in isolating the number highlighted in red; however, the function (or combo of functions) must be able to gather numbers that may be multiple digits in length.

    Super thanks in advance,

    Phil

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Isolate string of next

    Looks like you want to extract the 1st number in the string.

    Assuming that number will not have leading 0s (02):

    =LOOKUP(1E100,--MID(A2,MIN(FIND({1,2,3,4,5,6,7,8,9,0},A2&1234567890)),ROW(INDIRECT("1:"&LEN(A2)))))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Isolate string of next

    We might be able to use a less complicated formula if the characteristics of the number follow some constant rules.

    For example...

    The number will never be more than 6 digits long.
    The number will not have leading 0s.
    The number is always located after the 1st colon.

    =LOOKUP(1E100,--MID(A2,FIND(":",A2)+1,{1,2,3,4,5,6}))

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: Isolate string of next

    Yes, I was wondering if you could look for the colon and the comma - how common are these in your data? Can you post a few more examples, showing the range of text strings that you might encounter?

    Pete

  5. #5
    Registered User
    Join Date
    06-18-2013
    Location
    Indianapolis
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Isolate string of next

    Here are some more to parse for fun:

    IN.Tags.Share.handleCount({"count":232,"fCnt":"2","fCntPlusOne":"3","url":"http:\/\/relevance.com\/blog\/blog-editing-tip-use-adverbs-carfeully\/"});

    IN.Tags.Share.handleCount({"count":47,"fCnt":"1","fCntPlusOne":"2","url":"http:\/\/blog.avectra.com\/spend-a-day-in-the-life-of-a-member\/"});

    In short, it's basically what the LinkedIn API spits out; therefore, the general form should be the same for each call.

    You all are great. Thank you again,

    Phil

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Isolate string of next

    This should work:

    =LOOKUP(1E100,--MID(A2,FIND(":",A2)+1,{1,2,3,4,5,6}))

+ 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