+ Reply to Thread
Results 1 to 5 of 5

Find a variable text string in a cell and copy this to another cell

  1. #1
    Registered User
    Join Date
    04-01-2014
    Location
    New York, NY
    MS-Off Ver
    Excel 2011
    Posts
    11

    Find a variable text string in a cell and copy this to another cell

    Dear Excel Wizards,

    I am stumped with this problem. I have a Excel file with URLs. I want to extract one part of the URL, the only problem is the text I want to extract changes a bit. It will always start with "id=", however after that it can have 4, 5 or 6 numbers following. E.g

    id=1234
    id=12345
    id=123456

    The output I am looking for is the "id=12345" pasted into another call. Note: the string "12345" is just an example. Real output will be all numeric but not in such a neat order.

    So far I have tried to count and take the data from the 10th "/" where this the text field of 'id=' usually lives. I say usually because counting slashes I found the vast majority of my 'id=' I am looking for are between the 10th and 11th "/" but some are between the 8th and 9th "/".

    I have also tried
    =MID(A8,FIND("id=",A1),MATCH(FALSE,INDEX(CODE(MID(A8,ROW(INDIRECT(FIND("id=",A8)+2 & ":" & LEN(A8))),1))<65,0),0))
    to no success.

    I would appreciate any help you can lend. Please see the attached sample .xlsx for examples of the URL.

    Thanks again,
    Tim
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Find a variable text string in a cell and copy this to another cell

    Hi,

    One way

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Find a variable text string in a cell and copy this to another cell

    Or this

    =SUBSTITUTE(MID(A1,FIND("_",A1)+1,7),"/","")
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Registered User
    Join Date
    04-01-2014
    Location
    New York, NY
    MS-Off Ver
    Excel 2011
    Posts
    11

    Re: Find a variable text string in a cell and copy this to another cell

    Thank you so much Excel Forum! I went with AlKey's answer and I modified it slightly to work in a different context. Thanks again! Works like a charm.

    Tim

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Find a variable text string in a cell and copy this to another cell

    You're welcome and thank you for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Find partial text string within another text string return original text into cell.
    By mikey42979 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-17-2013, 02:58 PM
  2. [SOLVED] VBA Needed to find number/text within cell string and copy out to new cell
    By Campbell A in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-19-2013, 10:15 AM
  3. How to find a cell adjacent another cell using a string variable
    By Ace of Clubs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-15-2009, 02:52 AM
  4. how to find Certain String in a column, select/Copy the cell till another String
    By excelkeechak in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-18-2009, 10:59 AM

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