+ Reply to Thread
Results 1 to 10 of 10

Find string of text within a cell and then replace the cell with new text

  1. #1
    Forum Contributor
    Join Date
    03-26-2021
    Location
    California, US
    MS-Off Ver
    MS Office 2010
    Posts
    105

    Find string of text within a cell and then replace the cell with new text

    Friends,

    So, here's the situation:

    I have cells containing such info:

    123-ABC-321
    99999 nam 7
    ---, - jane 000

    How can I lookup, for example, ABC, then based on it, replace the whole cell into a new cell to something like: Anderson?
    Another example, for, nam, look up, nam, then replace the whole cell to a new cell to something like: Jason.

    Am I making sense?

    Please let me know if I need to explain or attach a file for better comprehension.

    It's really that much I needed. To simply look up a string of text within a cell then replace the whole cell into something anything I would like it to be.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,228

    Re: Find string of text within a cell and then replace the cell with new text

    attach a file for better comprehension.
    ....Yes please!
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Forum Contributor
    Join Date
    03-26-2021
    Location
    California, US
    MS-Off Ver
    MS Office 2010
    Posts
    105

    Re: Find string of text within a cell and then replace the cell with new text

    I hope this helps.

    Column A has unique items.

    Column B shows names that will need to be looked up.

    Column C will be the text the whole Column A cells are to be fully replaced with.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,228

    Re: Find string of text within a cell and then replace the cell with new text

    SECURI (yet again!!) does not like the code so inserted in attached WORD document

    =exchange(A2)

    added named range "Lookup_Tbl"
    Attached Files Attached Files
    Last edited by JohnTopley; 04-22-2022 at 03:55 AM.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,083

    Re: Find string of text within a cell and then replace the cell with new text

    I interpreted this differently...


    =INDEX($C$2:$C$5,SUMPRODUCT(IF(--ISNUMBER(SEARCH($B$2:$B$5,A2)),ROW($C$2:$C$5)))-ROW($C$2)+1)
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: Lá fhéile Pádraig sona dhaoibh

  6. #6
    Forum Contributor
    Join Date
    03-26-2021
    Location
    California, US
    MS-Off Ver
    MS Office 2010
    Posts
    105
    Quote Originally Posted by Glenn Kennedy View Post
    I interpreted this differently...


    =INDEX($C$2:$C$5,SUMPRODUCT(IF(--ISNUMBER(SEARCH($B$2:$B$5,A2)),ROW($C$2:$C$5)))-ROW($C$2)+1)
    This!

    Thank you very much!

    Absolutely, perfect!

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,083

    Re: Find string of text within a cell and then replace the cell with new text

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,228

    Re: Find string of text within a cell and then replace the cell with new text

    Too late! but change last line of code to

    Exchange = xsub

  9. #9
    Forum Contributor
    Join Date
    03-26-2021
    Location
    California, US
    MS-Off Ver
    MS Office 2010
    Posts
    105

    Re: Find string of text within a cell and then replace the cell with new text

    Thank you very much for your time and support.

    I was actually looking for what Glenn Kennedy has provided.

    But thank you, really.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,228

    Re: Find string of text within a cell and then replace the cell with new text

    No problem!!!

+ 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. Replies: 8
    Last Post: 04-07-2022, 11:50 AM
  2. Find and Replace a string of text in one cell with the value of another cell
    By RJacobsen83 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2019, 11:10 PM
  3. [SOLVED] Search cell A1 for text string from B1, replace with text string from C1
    By portokie in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-22-2019, 09:16 AM
  4. Replace text string in a cell and retain rich text formatting (Excel 2013)
    By CharlieBear in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-15-2015, 04:39 PM
  5. Replies: 3
    Last Post: 02-14-2014, 08:08 AM
  6. [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
  7. [SOLVED] VBA to Search a Text String, Find a Value listed in another column and replace the text
    By Jschrod303 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-16-2012, 08:56 PM

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