+ Reply to Thread
Results 1 to 5 of 5

How do I extract a portion of a string into an adjacent cell?

  1. #1
    Registered User
    Join Date
    03-25-2012
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    2

    Question How do I extract a portion of a string into an adjacent cell?

    Hello! Here is the basic situation, I have one cell with text and a hyperlink. I found a macro to run that extracted the hyperlink into the cell in the next column. Now what I would like to do is further extract just a portion of the hyperlink into the next cell. Does any one have an idea how I might do that? The first 3 characters of the portion I would like extracted are always the same, it is always a length of 10 characters, and it is always between two slashes, for example /ABC1234567/. Thanks if you can help!!

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: How do I extract a portion of a string into an adjacent cell?

    Hi there, im currently on a PC without excel so i cannot test, but you shoudl be able to do this with something like this

    =MID(A1,FIND("/ABC",A1)+1,10)
    Last edited by DGagnon; 03-25-2012 at 10:52 PM. Reason: Formula Corrected
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: How do I extract a portion of a string into an adjacent cell?

    back on an Excel enabled PC, the above had an error in the FIND function, i got the paramaters mixed up the bellow should work for you

    =MID(A1,FIND("/ABC",A1)+1,10)

    if you want to include the /'s you can use this.

    =MID(A1,FIND("/ABC",A1),12)

  4. #4
    Registered User
    Join Date
    03-25-2012
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: How do I extract a portion of a string into an adjacent cell?

    Thank you, thank you!! That worked exactly how I needed it to! You have saved me days worth of time doing it manually. I actually tried the first formula you gave before I saw the corrected one, and noticed the two things in FIND were switched. In my particular case, and if anyone else is reading this with the same question, the formula works the same without the +1 if the / is removed from the quotes. Thanks again for your help, DGagnon! <3

    Same results in my case:
    =MID(A1,FIND("/ABC",A1)+1,10)
    =MID(A1,FIND("ABC",A1),10)

  5. #5
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: How do I extract a portion of a string into an adjacent cell?

    No problem, glad i could help, and yes that should work, i was just including the / to add one more bit of uniqueness to the search.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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