+ Reply to Thread
Results 1 to 5 of 5

Can i substitute using a cell reference?

  1. #1
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Orlando
    MS-Off Ver
    Excel 2016
    Posts
    191

    Can i substitute using a cell reference?

    Im looking for a formula =SUBSTITUTE(I2, "{keyword}", "test") but in place of the word test i want to use a cell reference like C2. Can you use substitute in this way?

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Can i substitute using a cell reference?

    Definately.

    =SUBSTITUTE(I2, "{keyword}", C2)

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Can i substitute using a cell reference?

    do you not think it might have been quicker to try it? than post on a forum and wait for a reply?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Can i substitute using a cell reference?

    Have you tried it?

    Yes, you can do that.

    I2 = I love this junk
    C2 = stuff

    =SUBSTITUTE(I2,"junk",C2)

    Note that SUBSTITUTE is case sensitive. "junk" must be an exact match of junk in the source string.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Orlando
    MS-Off Ver
    Excel 2016
    Posts
    191

    Re: Can i substitute using a cell reference?

    Quote Originally Posted by martindwilson View Post
    do you not think it might have been quicker to try it? than post on a forum and wait for a reply?

    I did try it and it was giving me an error apparently i was putting a comma after C2 oops.

+ 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] IFTEXT & SUBSTITUTE in same cell?
    By tk240381 in forum Excel General
    Replies: 9
    Last Post: 12-14-2012, 11:32 AM
  2. [SOLVED] Vlookup or If/Then to return a substitute cell for a cell that matches itself in a range
    By Shadefalcon in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 11-13-2012, 06:02 PM
  3. How to substitute dates using cell reference in SQL query using VBA
    By labman39 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-29-2012, 01:07 AM
  4. [SOLVED] substitute chatracters within a cell
    By Shan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2006, 10:40 AM
  5. Replies: 11
    Last Post: 02-22-2006, 09:20 AM

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