+ Reply to Thread
Results 1 to 8 of 8

substitute

  1. #1
    Registered User
    Join Date
    02-02-2018
    Location
    fremont,ca
    MS-Off Ver
    2016
    Posts
    34

    substitute

    Hi

    I know how to use simple substitute
    for example,

    =substitute(A1, 2019,2020) will do replace 2019 with 2020,

    How about if I want to do dynamically, like to replace with "YEAR" with "YEAR+1"

    like replace 2014 with 2015, 2013 with 2014...

    Thanks,
    James

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: substitute

    If there is only year in A1 then
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    will do
    If the year is at the end of text, like in
    finished 2019
    then use
    =SUBSTITUTE(A1,RIGHT(A1,4),RIGHT(A1,4)+1)
    and so on.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    02-02-2018
    Location
    fremont,ca
    MS-Off Ver
    2016
    Posts
    34

    Re: substitute

    Thanks,I understand what you are saying
    so for following, it would eb difficult

    Olim Bauda Barbera D'Asti Superiore Nizza DOCG Barbera 2015 1/3L

  4. #4
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: substitute

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

    Why not in simple way


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  5. #5
    Valued Forum Contributor
    Join Date
    01-14-2013
    Location
    Austria
    MS-Off Ver
    2016 / 2019
    Posts
    339

    Re: substitute

    if the year is in cell "I4" and your string is in A1
    Please Login or Register  to view this content.
    cheers

  6. #6
    Registered User
    Join Date
    02-02-2018
    Location
    fremont,ca
    MS-Off Ver
    2016
    Posts
    34

    Re: substitute

    =SUBSTITUTE(A1;MID(A1;FIND($I$4;A1);4);MID(A1;FIND($I$4;A1);4)+1)

    above seems not solve my issue

    for example, I have string " I have 2017 wine", I want to change to "" I have 2018 wine" ( replace "2017" with "2017+1")

    It may not be doable, I guess

  7. #7
    Valued Forum Contributor
    Join Date
    01-14-2013
    Location
    Austria
    MS-Off Ver
    2016 / 2019
    Posts
    339

    Re: substitute

    what exactly happens? (may be I forgot to tell that you have to change ";" to "," (german layout --> english)

    look into the attachment
    Attached Files Attached Files

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,820

    Re: substitute

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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] Indirect "Substitute(Substitute(" not working for multiple spaces
    By Ochimus in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-03-2018, 04:01 PM
  2. Replies: 4
    Last Post: 10-28-2014, 11:04 PM
  3. How to use a substitute formula to substitute text entries to a different text entry
    By andybocchi in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-01-2010, 07:50 PM
  4. [SOLVED] substitute for =
    By CEN7272 - ExcelForums.com in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 PM
  5. substitute
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 07:05 AM
  6. [SOLVED] substitute
    By AMK in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  7. substitute for =
    By CEN7272 - ExcelForums.com in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 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