+ Reply to Thread
Results 1 to 4 of 4

Extracting Information from a cell

  1. #1
    Registered User
    Join Date
    04-25-2004
    Posts
    4

    Extracting Information from a cell

    Ok, I am drawing a blank and I have spent 2 hours trying to figure out how I can do this in Excel and I beleive there is even a command for what I am looking for, but I am still can not figure it out. I will give you example of the data below. Basically I am looking to extract characters in the data, but I need it to search for the starting characters and then put that text all the way up to a certain word only. I know how to do it with the MID command, but the problem I have is that the MID command starts at X character and captures X amount of characters from that point forward. My data that I need to extract will be different lengths, but it will always begin with the same word and it will always end with the same word.

    Here is 1 line of code that I need to extract. Technically there is going to be 25 lines like this per HTML file.

    See were it says "contest_id..." that is were I want start to extract from and the last word I want it to go to is "Photoshop".

    So on the example below it would extract the following information and put it in a cell. From that point I can create the web address again by merging cells.

    contest.asp?contest_id=21345&display=photoshop

    Example:

    <tr bgcolor=''><td class='divider'><a href='/contest.asp?contest_id=21345&display=photoshop'><img style='width:75px' src='http://rookery1.plime.com/storage/41500/41707_e999_sqr.jpg' border='0' /></a></td><td class='divider'><a href='/contest.asp?contest_id=21345&display=photoshop' class='color4 td b'>Corrupted Innocence 5</a><br />When good things go very, very bad.</td><td class='divider'><span class='red4'>ended 10/13/2008</span></td><td class='divider'>30 entries</td></tr>


    Thank you for your help!

    RadicalROM

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try this MID() formula:

    =MID(A1,SEARCH("contest_id",A1),SEARCH("photoshop",A1)-SEARCH("contest_id",A1)+9)

    Adjust A1 ref to suit.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    04-05-2009
    Location
    Brisbane, Australia
    MS-Off Ver
    Office 365
    Posts
    71

    Re: Extracting Information from a cell

    This code sort of does what I'm trying to do, just not on so many levels. I have a number of cells containing dates & times, which are exported from a database. I want to be able to extract the date, and place that in one cell - then extract the time and place it in another cell.

    Here is an example of the contents of a specific cell.

    20/04/2009 5:42:51 AM

    Any help on this would be greatly appreciated.



    Thanks,
    Xtopher

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Extracting Information from a cell

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.
    Entia non sunt multiplicanda sine necessitate

+ 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