+ Reply to Thread
Results 1 to 3 of 3

Substitute multiple data with a table, instead of a long =substitute string.

  1. #1
    Registered User
    Join Date
    06-25-2017
    Location
    Australia
    MS-Off Ver
    365
    Posts
    76

    Question Substitute multiple data with a table, instead of a long =substitute string.

    I have a column of words that I would like to automatically substitute to other words.

    BAD Words GOOD Words
    AAA 111
    BBB 222
    CCC 333
    ...etc


    I currently use a Substitute formula, but it's grown veeeeeeery long. (ie, =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE... x38).

    I found out you can create a table, with the bad words in columnA and good words in column B, then use the following formula to automatically convert them:

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


    That works fine... except if it finds a word not in the table, it returns an #N/A error.

    Using the =Substitute string works better because if it finds a Bad Word NOT in the substitute string, it just carries over the original. The Table Formula doesn't do this.

    Can it? Is there something you can add that basically says "Convert Bad Word to Good Word using Table1 as reference, but if it's not in Table1, just use the Bad Word"?
    Last edited by 2vbr; 09-27-2020 at 11:00 PM.

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

    Re: Substitute multiple data with a table, instead of a long =substitute string.

    Try:
    =iferror(INDEX(Table1["Good Words"],MATCH(A1,Table1["Bad Words"],0)),A1)
    Quang PT

  3. #3
    Registered User
    Join Date
    06-25-2017
    Location
    Australia
    MS-Off Ver
    365
    Posts
    76

    Re: Substitute multiple data with a table, instead of a long =substitute string.

    Oh wow, that works perfectly.

    Thankyou VERY much!

+ 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] Find string to substitute
    By tao94539 in forum Excel General
    Replies: 11
    Last Post: 04-19-2020, 11:44 PM
  2. [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
  3. [SOLVED] Substitute alphanumeric string into a comma separated string
    By icyrius in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-09-2017, 07:16 AM
  4. Substitute formula lower and upper case character and long text problem
    By silambarasan.J in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-08-2016, 09:41 AM
  5. Replies: 4
    Last Post: 10-28-2014, 11:04 PM
  6. [SOLVED] Substitute a text string with multiple values
    By dihris in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-03-2012, 03:25 PM
  7. Substitute: any particular letter in string
    By daffykyle in forum Excel General
    Replies: 6
    Last Post: 05-26-2011, 09:11 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