+ Reply to Thread
Results 1 to 7 of 7

Formula to find text in a cell - Looking for the formula

  1. #1
    Registered User
    Join Date
    02-01-2012
    Location
    Oxford
    MS-Off Ver
    Excel 2007
    Posts
    10

    Smile Formula to find text in a cell - Looking for the formula

    Hi,

    I have a string of text which reads like
    "START, PAUSE, GO, PAUSE, STOP"

    Im basically now looking for a formula which will give either a yes/no/true/false answer to whether a text cell contains certain information (and even better if i can tell you if the cell contains the infomation more than once)

    I.E
    Is there a formula that would check if there if a cell contains (in this case) "PAUSE" twice

    Ive heard of FIND/SEARCH functions but don't know how to use it in the way i am looking for (if possible)

    Any help appreciated

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Formula to find text in a cell - Looking for the formula

    One way to check cell A1:

    =IF((LEN(A1)-LEN(SUBSTITUTE(A1,"PAUSE","")))/2=LEN("PAUSE"),"in twice","")


    Regards,TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    02-01-2012
    Location
    Oxford
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Formula to find text in a cell - Looking for the formula

    Excellent !
    Just what i needed.
    I dont really understand the formula but its what i need
    Thank you !

  4. #4
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Formula to find text in a cell - Looking for the formula

    You can use "*" in SEARCH, like

    =IF(ISNUMBER(SEARCH("Pause*pause",A1)),"Yes","No")
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  5. #5
    Registered User
    Join Date
    02-01-2012
    Location
    Oxford
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Formula to find text in a cell - Looking for the formula

    TMShucks
    Actually - This is great.
    But I have a few examples where i have PAUSE in the text more than twice, and using the above it returns a blank cell because it doesn't contain exactly 2.
    Is there a way this can be adapted so it shows if the cell contains PAUSE more than once?

    Sorry! :{

  6. #6
    Registered User
    Join Date
    02-01-2012
    Location
    Oxford
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Formula to find text in a cell - Looking for the formula

    Quote Originally Posted by Haseeb A View Post
    You can use "*" in SEARCH, like

    =IF(ISNUMBER(SEARCH("Pause*pause",A1)),"Yes","No")
    This answers my last question

    Thanks BOTH!

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Formula to find text in a cell - Looking for the formula

    =IF((LEN(A1)-LEN(SUBSTITUTE(A1,"PAUSE","")))/2>=LEN("PAUSE"),"in more than once","")

    Regards

+ 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