+ Reply to Thread
Results 1 to 3 of 3

How to shorten the formula - IF(SUM(COUNTIF(

  1. #1
    Registered User
    Join Date
    03-08-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    27

    How to shorten the formula - IF(SUM(COUNTIF(

    Hi,

    Formula : =IF(SUM(COUNTIF(B2,{"*VACCIN*","*IBACK*","*BUSINESS*","*ICAEW*","*RECRUIT*"}))>0,"NT","T")

    I have created a formula to detect certain words contain in a sentence. If the sentence contains the word in my list, the result is "NT", otherwise the result is "T".

    I would like to seek for help to shorten the formula as the word I am looking for can be a lot (I just put a few examples of word in the above formula). The formula has to provide the flexibility to detect word like "vaccinations".

    I have enclose the excel file for your reference.

    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: How to shorten the formula - IF(SUM(COUNTIF(

    Try using a reference to the list in the formula, e.g. as you have the words listed in A16:A20

    =IF(SUMPRODUCT(COUNTIF(B2,"*"&A$16:A$20&"*"))>0,"NT","T")
    Audere est facere

  3. #3
    Registered User
    Join Date
    03-08-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: How to shorten the formula - IF(SUM(COUNTIF(

    It works :-) Thanks a lot.

+ 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