+ Reply to Thread
Results 1 to 7 of 7

Replacing specific text by “”

  1. #1
    Forum Contributor
    Join Date
    02-21-2007
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    389

    Replacing specific text by “”

    Hello,

    I have a reference in my workbook that I no longer need starting by F (+6 number) and I (+5 number) following by :

    example: I12345: F123456:

    In the cell A1 I have the following text:

    A1 = "I12345: Formal Data - Reports or SQL data purchase"

    C1 = "F178456: PROC Performance

    F178457: PROC System testing

    F178458: PROC testing”


    My goal is to get

    A1 = "Formal Data - Reports or SQL data purchase"

    C1 = "PROC Performance

    PROC System testing

    PROC testing”

    Would you know if a formula can do that? I have tried with =REPLACE(A1;1;8;"") but I could only remove the references at the beginning of the cell. Which is not what I want.

    EG: C1 = "PROC Performance

    F178457: PROC System testing

    F178458: PROC testing"



    You may have a better formula

    Many thanks in advance,
    Graig

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Replacing specific text by “”

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

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Replacing specific text by “”

    With A1 probably is:

    "I12345: Formal Data - Reports or SQL data purchase"
    "F123456: Formal Data - Reports or SQL data purchase"
    "Formal Data - Reports or SQL data purchase"
    " 12345: Formal Data - Reports or SQL data purchase" (With : )
    "F : XXXX" (With F and : )

    Please Login or Register  to view this content.
    Quang PT

  4. #4
    Forum Contributor
    Join Date
    02-21-2007
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    389

    Re: Replacing specific text by “”

    Hello,

    It Works only on the first reference.

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Replacing specific text by “”

    It might make it easier to help if we could see a sample .xlsx file (instructions given in banner at the top of the page).
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  6. #6
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Replacing specific text by “”

    I've never understood the preference for RIGHT(s,LEN(s)-FIND(x,s)) vs the arguably clearer REPLACE(s,1,FIND(x,s),"") with one fewer function call.

    Then again, if only Excel had regular expressions like in LibreOffice Calc. =REGEX(A7,"\b[FI]\d+: *","","g")

  7. #7
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Replacing specific text by “”

    This something Excel handles rather poorly. You could try using the Find and Replace dialog. Select the range needing these edits. Press [Ctrl]+H to display the dialog. First enter F??????: as Find what, clear the field for Replace with, and click on the Replace All button. Then enter I?????: as Find what and click on the Replace All button.

    Clarification: The Find what entries above include a space character following the colon.

    The only robust way to do this with formulas is to write a user-defined function in VBA which makes use of the Windows Script Host DLL's regular expression object. Are you open to using VBA?
    Last edited by hrlngrv; 10-10-2020 at 06:11 PM. Reason: clarification

+ 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. Replacing specific text in multiple text boxes based on cell values
    By ettevi23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2017, 09:21 PM
  2. [SOLVED] Help replacing specific text
    By xeion_ff7 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-17-2016, 05:17 PM
  3. [SOLVED] Replacing specific text in string from same column...
    By netsecrets00 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-05-2014, 02:56 AM
  4. [SOLVED] Replacing specific text in multiple cells
    By nobodyNZ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-13-2014, 11:19 AM
  5. Replacing specific text in a cell by row and replace with text in another row
    By merQrey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-23-2014, 10:05 AM
  6. Replacing specific text in cell
    By SSB in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-22-2012, 01:57 PM
  7. [SOLVED] Replacing specific characters
    By Trey in forum Excel General
    Replies: 3
    Last Post: 01-20-2006, 08:00 PM

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