+ Reply to Thread
Results 1 to 10 of 10

Formula - if cell contains certain words in any order

  1. #1
    Registered User
    Join Date
    04-07-2017
    Location
    Barfird
    MS-Off Ver
    Mac
    Posts
    1

    Formula - if cell contains certain words in any order

    Hi all,

    I need a formula to count if a cell contains the words 'best' and 'crm' in any order. For example:

    Screen Shot 2017-04-07 at 12.46.54.png

    What formula would I use in B1 - B5 to get a true value for cells A1 to A4, but a false value for A5?

    Thanks!

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Formula - if cell contains certain words in any order

    =AND(ISNUMBER(SEARCH("best",A1)),ISNUMBER(SEARCH("crm",A1)))

    Someone's bound to put this as an alternative so I'll try and beat them to it

    =AND(ISNUMBER(SEARCH({"best","crm"},A1)))
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Formula - if cell contains certain words in any order

    Hi

    a possible approach

    =isnumber(search("best",A1)*search("crm",A1))

    Regards

    Edit: sorry Special-K I did not mean to overlap. Same concept.
    Last edited by canapone; 04-07-2017 at 07:55 AM.
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Formula - if cell contains certain words in any order

    perhaps

    =COUNTIFS(A1,"*"&"best"&"*",A1,"*"&"crm"&"*")

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,791

    Re: Formula - if cell contains certain words in any order

    Put this in B1:

    =AND(ISNUMBER(SEARCH("best",A1)),ISNUMBER(SEARCH("crm",A1)))

    then copy down.

    Another way would be:

    =COUNTIFS(A1,"*best*",A1,"*crm*")>0

    Note the asterisks around the words.

    Hope this helps.

    Pete

  6. #6
    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
    81,262

    Re: Formula - if cell contains certain words in any order

    Welcome to the forum!

    Suggestion removed - doesn't work as intended - sorry!
    Last edited by AliGW; 04-07-2017 at 08:27 AM.
    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.

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,791

    Re: Formula - if cell contains certain words in any order

    WOW, so many responses within 3 minutes of each other.

    Pete

  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
    81,262

    Re: Formula - if cell contains certain words in any order

    Quote Originally Posted by Pete_UK View Post
    WOW, so many responses within 3 minutes of each other.

    Pete

  9. #9
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Formula - if cell contains certain words in any order

    Quote Originally Posted by AliGW View Post
    Welcome to the forum!

    In B1 copied down:

    =IFERROR(SEARCH("best",A1)+SEARCH("crm",A1)>1,FALSE)
    1, 2, 3 opening brackets...
    1, 2, 3 closing brackets...

    Yep, all there!

  10. #10
    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
    81,262

    Re: Formula - if cell contains certain words in any order

    It's a new day and I am properly caffeinated.

+ 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] Reversing the Order of Words in Columns
    By PaulBollard in forum Excel General
    Replies: 20
    Last Post: 01-13-2017, 12:22 PM
  2. [SOLVED] Macro usage in order to highlight/format particular words in cell
    By chancechristensen in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-16-2015, 09:36 PM
  3. [SOLVED] reverse the order of words with formula
    By Aquamore in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-15-2014, 10:22 PM
  4. [SOLVED] Fixing a macro intended to retreive words from a cell according to their order
    By Sbselby in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-19-2014, 06:39 PM
  5. [SOLVED] Swap order of words in a cell
    By jessiebelle1980 in forum Excel General
    Replies: 4
    Last Post: 01-08-2014, 11:44 AM
  6. [SOLVED] How to use mutiple words in any order to display a cell
    By Eagleintl1 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-30-2013, 06:00 PM
  7. Rearrange order of words
    By NPM2 in forum Excel General
    Replies: 3
    Last Post: 11-22-2009, 06:58 PM

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