+ Reply to Thread
Results 1 to 10 of 10

Search text formula.

  1. #1
    Registered User
    Join Date
    08-01-2014
    Location
    Nowhere in particular
    MS-Off Ver
    MSO2010
    Posts
    15

    Search text formula.

    Hi,

    I have the following example:

    Cell A1 contains text; 180CEST
    Cell A2 contains text; 180DEST
    Cell A3 contains text; 180EEST
    Cell A4 contains text; 180AEST
    Cell A5 contains text; 180FEST

    What's the best formula combination so that I get the result "YES" if A1:A5 contains the word "FEST" and "NO" if the the word isn't there? Case must be insensitive so that any combination of capitals or small letters doesn't matter. I know this must involves IF and SEARCH functions but I just can't seems to get it work.

    Regards.
    Last edited by molosser; 09-02-2014 at 07:05 PM.

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Search text formula.

    Try this formula

    =IF(ISNUMBER(SEARCH("FEST",A1)),"Yes","No")

    A
    B
    C
    1
    180DEST No
    2
    180EEST No
    3
    180AEST No
    4
    180FEST Yes
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Search text formula.

    =if(countif(a1:a4,"*"&"fest"&"*")>=1,"yes","no")

  4. #4
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Search text formula.

    I got it with an array formula (confirm with ctrl+shift+enter, not just enter key):

    Please Login or Register  to view this content.
    That will add up all the results of SEARCH while treating errors as zero, and use that as the input to the IF test.

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Search text formula.

    @cbatrody

    It could be even smaller

    =IF(COUNTIF(A1:A4,"*FEST*"),"Yes","No")

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

    Re: Search text formula.

    If the string FEST is always the 4 right-most characters:

    =IF(COUNTIF(A1:A5,"*FEST"),"Yes","No")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Search text formula.

    Another way,

    =IF(ISTEXT(VLOOKUP("*FEST*",A1:A5,1,0)),"YES","NO")

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Search text formula.

    if the word fest is always on the end of the text you could use also this solution.

    b1=if(right(a1,4)="fest","yes","no")

    and drag down.

    c1= if(countif(b1:b5,"yes")>=1,"yes";"no")
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  9. #9
    Registered User
    Join Date
    08-01-2014
    Location
    Nowhere in particular
    MS-Off Ver
    MSO2010
    Posts
    15

    Re: Search text formula.

    Sorry for the very late reply guys, appreciate all the help very much.
    Turns out, using the COUNTIF function is the simplest way for me.

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

    Re: Search text formula.

    Good deal. Thanks for the feedback!

+ 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. Search by Text formula needed
    By jakke655321 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-28-2014, 04:17 PM
  2. VBA Code - Search text & search number & search qty and result - Urgent Please
    By naresh73 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2014, 10:51 AM
  3. [SOLVED] search for text, then search for previous text, replace 1st text including number from 2nd
    By kldailey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-06-2012, 05:23 PM
  4. search a text in a column with a formula
    By j_r_m_c in forum Excel General
    Replies: 3
    Last Post: 02-12-2011, 04:52 PM
  5. Replies: 2
    Last Post: 06-24-2010, 05:32 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