+ Reply to Thread
Results 1 to 8 of 8

Need to find text in a named range, and return part of the text to a single cell

  1. #1
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    110

    Need to find text in a named range, and return part of the text to a single cell

    Hi Gurus,

    I am not sure if this is completed by a formula or VBA, but I think a formula would work.

    Column A
    RIM*RT 123456
    RIM*RS 654321
    RIM*RW TestName

    The above example is in the named range (Text), the whole values sit in column A. I need a formula that will look at the named range and if it finds RIM*RS return 654321. I have a lot of cells in Column A, so just a bunch of ifs, will not work. I would like one formula I could put in cell D1, that would return the 654321,if the criteria is met. Then have it look for RIM*RT in say cell E1. Please let me know if you need a better explanation.

    Thanks in advance.

  2. #2
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Need to find text in a named range, and return part of the text to a single cell

    So, return everything after the search criteria?
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  3. #3
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: Need to find text in a named range, and return part of the text to a single cell

    Sorry, a set number of characters.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2000/3/7/10/13/16/365
    Posts
    51,898

    Re: Need to find text in a named range, and return part of the text to a single cell

    Not sure if this is what you are looking for or not. Assuming your data is in column A, and the search string (RIM*RS) is in C1, use this...

    =RIGHT(VLOOKUP(C1&"*",$A$1:$A$3,1,FALSE),LEN(VLOOKUP(C1&"*",$A$1:$A$3,1,FALSE))-LEN(C1))

    Adjust ranges as needed. if you copy this down, and have other values in C2, C3 etc, it will pull out the other values too
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    10-25-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2007
    Posts
    71

    Re: Need to find text in a named range, and return part of the text to a single cell

    Try this in D1 and copy all the way down.

    Please Login or Register  to view this content.
    If the size of the information to be returned is longer that 20 characters, you will need to change that to a larger number.

  6. #6
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: Need to find text in a named range, and return part of the text to a single cell

    Thank you very much. I am much closer to what I am trying to do, thanks to your help. If I wanted to limit the return to a set number of characters, could that be done? Say only the first 4 from the result of you provided.

    Thanks again.

  7. #7
    Registered User
    Join Date
    10-25-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2007
    Posts
    71

    Re: Need to find text in a named range, and return part of the text to a single cell

    Yes, change the 20 to a 4 or however many digits you want to return. If you want a blank instead of the 0 change the last 0 to "".

  8. #8
    Registered User
    Join Date
    10-25-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2007
    Posts
    71

    Re: Need to find text in a named range, and return part of the text to a single cell

    Here is the breakdown on the formula

    Please Login or Register  to view this content.
    SEARCH("RIM*RS",A1) is looking in cell A1 for RIM*RS
    IFERROR (search,0) will return a 0 if the search function errors out.
    MID(A1,8,20) grabs the information in cell A1 starting at the 8th character and continues for 20 characters.
    Clean (mid) removes the non printable characters, i.e. any blank spaces at the end.

    IF (error check = 1, cleanmid, 0) will return the requested information if RIM*RS search is valid, or a 0 if not.

+ 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