+ Reply to Thread
Results 1 to 4 of 4

Extracting a specific string from all cells?

  1. #1
    Registered User
    Join Date
    10-23-2012
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    9

    Angry Extracting a specific string from all cells?

    How does one extract a specific sting/words from each cell?
    Especially if [formatted data] varys in characters (not suitable for regular LEFT, MID, RIGHT functions use).

    Take a look at the attachment.

    Sample Question.xlsx
    Last edited by wearwestern; 10-25-2012 at 03:13 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Extracting a specific string from all cells?

    Try =MID(A2,SEARCH(".html",A2)-6,6)
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    10-23-2012
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Extracting a specific string from all cells?

    Yes. Thank you. I am sending oceans of reps right now.

    So essentially what this function does is?
    =MID[TargetCell, Search("specificstring",targetcell)-???, return 6 characters)?
    Last edited by wearwestern; 10-25-2012 at 03:28 PM. Reason: repped

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Extracting a specific string from all cells?

    Search returns the starting position of a string or a single character. We use it to find where we want to extract our 6 characters using MID
    =MID (Target Cell, starting point, # of characters)
    Since the starting point of ".html" is actually 6 characters after the beginning of what we want to extract, I subtract 6 from the value returned by SEARCH

    Hope that helps.

+ 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