+ Reply to Thread
Results 1 to 7 of 7

SUBSTITUTION Problem!

  1. #1
    Forum Contributor
    Join Date
    06-18-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    106

    SUBSTITUTION Problem!

    Hello Excel friends,

    I have this apparently simple problem to help solve.

    Looking at the attached spreadsheet it should be clear that the output column should always output what is in the desired output column.

    I.E that the parameters in the first 7 columns should be substituted correctly in the format listed in the input column, and this is to be outputted in the output column, such that one can copy down instantly

    Is there a quick formula based solution to this?

    Kind Regards,
    Attached Files Attached Files

  2. #2
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: SUBSTITUTION Problem!

    Hi niceguy21

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

  3. #3
    Forum Contributor
    Join Date
    06-18-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: SUBSTITUTION Problem!

    Quote Originally Posted by Kevin UK View Post
    Hi niceguy21

    In I3:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Many thanks for that useful tip Kevin,

    I believe I stated this problem incorrectly actually.. maybe you can further help...

    find attached the revised sheet: we are looking for a formula that can identify the parameters (in square brackets) in the input column and then output the correct parameters (see desired output).

    once solution to this is to create multiple columns each one making a certain number of substitutions.

    your thoughts...
    Attached Files Attached Files

  4. #4
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: SUBSTITUTION Problem!

    Hi niceguy21

    You have got me beat on that one Someone will come up with a solution. I will have another look later.

  5. #5
    Forum Contributor
    Join Date
    06-18-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: SUBSTITUTION Problem!

    Quote Originally Posted by Kevin UK View Post
    Hi niceguy21

    You have got me beat on that one Someone will come up with a solution. I will have another look later.
    haha, yes, us too.. the problem is that the substitution formula only substitutes ''text'' on an individual input basis such that you can't just reference one of the cells.

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: SUBSTITUTION Problem!

    You could just have a lot of nested substitute functions:
    Please Login or Register  to view this content.

    Note that substitute is case sensitive though, so I had to change the inputs to http://Coke.com/abc/[DEVICE]/[COUNTRY] so that it would find [DEVICE] and [COUNTRY] because [device] and [country] aren't found due to the case sensitivity.

    You could get around that by adding using the UPPER() function H3 within that formula, but then everything other than the replaced items would be capitalized in the result.
    Attached Files Attached Files
    Last edited by tigeravatar; 09-26-2012 at 12:49 PM. Reason: typo
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  7. #7
    Forum Contributor
    Join Date
    06-18-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: SUBSTITUTION Problem!

    Quote Originally Posted by tigeravatar View Post
    You could just have a lot of nested substitute functions:
    Please Login or Register  to view this content.

    Note that substitute is case sensitive though, so I had to change the inputs to http://Coke.com/abc/[DEVICE]/[COUNTRY] so that it would find [DEVICE] and [COUNTRY] because [device] and [country] aren't found due to the case sensitivity.

    You could get around that by adding using the UPPER() function H3 within that formula, but then everything other than the replaced items would be capitalized in the result.


    Many, Many thanks for your time on this... funnily enough we just worked out the exact same formula! although we have added in a Vlookup.

    I guess the learning here is that substitution formula can use cell references!!!!
    Last edited by niceguy21; 09-27-2012 at 07:33 AM.

+ 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