+ Reply to Thread
Results 1 to 10 of 10

Substituting symbol in a specific area within a string

Hybrid View

jj4jj Substituting symbol in a... 07-25-2015, 01:06 PM
shg Re: Substituting symbol in a... 07-25-2015, 01:09 PM
jj4jj Re: Substituting symbol in a... 07-25-2015, 01:13 PM
shg Re: Substituting symbol in a... 07-25-2015, 01:29 PM
jj4jj Re: Substituting symbol in a... 07-25-2015, 01:42 PM
shg Re: Substituting symbol in a... 07-25-2015, 01:55 PM
shg Re: Substituting symbol in a... 07-25-2015, 02:04 PM
jj4jj Re: Substituting symbol in a... 07-25-2015, 02:28 PM
shg Re: Substituting symbol in a... 07-25-2015, 02:57 PM
AlKey Re: Substituting symbol in a... 07-25-2015, 03:23 PM
  1. #1
    Registered User
    Join Date
    07-13-2015
    Location
    Slovakia
    MS-Off Ver
    2007, 2010, 2013
    Posts
    76

    Substituting symbol in a specific area within a string

    Good afternoon from Europe,

    I have to substitute the "_" symbol with an another symbol "+" in a specific area--------------all "_" lying between "/" and "CDE" in a text string.

    example:

    What I have:

    QQQ/AAA_BBB_CDE_FGH_IJK_LMN

    What i need:

    QQQ/AAA+BBB_CDE_FGH_IJK_LMN

    Is it possible to perform without a macro only with a function?

    Many thanks for every reply!

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Substituting symbol in a specific area within a string

    From your description, why isn't the second underscore replaced?

    Is it always just the first underscore? If not, please provide more examples.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    07-13-2015
    Location
    Slovakia
    MS-Off Ver
    2007, 2010, 2013
    Posts
    76

    Re: Substituting symbol in a specific area within a string

    I am sorry for unprecise explanation and examle...here´s a new one:

    example:

    What I have:

    QQQ/AAA_BBB_CCC_CDE_FGH_IJK_LMN

    What i need:

    QQQ/AAA+BBB+CCC_CDE_FGH_IJK_LMN

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Substituting symbol in a specific area within a string

    Row\Col
    A
    B
    C
    1
    QQQ/AAA_BBB_CCC_CDE_FGH_IJK_LMN QQQ/AAA+BBB+CCC_CDE_FGH_IJK_LMN B1: =SUBSTITUTE(LEFT(A1, FIND("_CDE", A1) - 1), "_", "+") & MID(A1, FIND("_CDE", A1), LEN(A1))
    2
    QQQ/AAA_BBB_CDE_FGH_IJK_LMN QQQ/AAA+BBB_CDE_FGH_IJK_LMN

  5. #5
    Registered User
    Join Date
    07-13-2015
    Location
    Slovakia
    MS-Off Ver
    2007, 2010, 2013
    Posts
    76

    Re: Substituting symbol in a specific area within a string

    thanks for reply and solution..in this example it´s working fine: but to be even more specific: the area of substitution lays between "/" and "CDE", so this function doesn´t work for following example:

    What I have:

    OOO_PPP_QQQ/AAA_BBB_CCC_CDE_FGH_IJK_LMN

    What i need:

    OOO_PPP_QQQ/AAA+BBB+CCC_CDE_FGH_IJK_LMN

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Substituting symbol in a specific area within a string

    That's why I asked for a representative set of examples.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Substituting symbol in a specific area within a string

    =LEFT(A1, SEARCH("/", A1))
    & SUBSTITUTE(LEFT(MID(A1, SEARCH("/", A1) + 1, LEN(A1)), SEARCH("_cde", MID(A1, SEARCH("/", A1) + 1, LEN(A1))) - 1), "_", "+")
    & MID(A1, SEARCH("_cde", A1), LEN(A1))
    Last edited by shg; 07-25-2015 at 02:09 PM. Reason: whitespace

  8. #8
    Registered User
    Join Date
    07-13-2015
    Location
    Slovakia
    MS-Off Ver
    2007, 2010, 2013
    Posts
    76

    Re: Substituting symbol in a specific area within a string

    working great, many thanks...and i am one more time sorry for my bad explanation...

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Substituting symbol in a specific area within a string

    You're welcome.

  10. #10
    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: Substituting symbol in a specific area within a string

    Deleted post
    Last edited by AlKey; 07-25-2015 at 03:26 PM.
    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

+ 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] Finding the last occurence of a symbol within a string
    By jj4jj in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-23-2015, 01:08 PM
  2. Parsing text from string starting with specific symbol
    By dcorner in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-08-2013, 10:32 AM
  3. Substituting Words in a String based on Synonym Lists
    By whatappears in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-11-2012, 11:57 AM
  4. Replies: 2
    Last Post: 08-23-2012, 03:12 AM
  5. Replies: 15
    Last Post: 07-05-2012, 12:49 PM
  6. the ' symbol ends the SQL string, how do you replace it Excel
    By Valori in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-02-2006, 09:50 PM
  7. [SOLVED] isolating a string containing a % symbol
    By bobadigilatis in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-27-2006, 07:35 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