You are reading a single comment by @pifko and its replies. Click here to read the full conversation.
  • This should be an easy one for you lot, but I have been struggling.
    I'm trying to write something which counts the number of times a particular word appears somewhere within a string. plsthanks

  • A quick and dirty solution, first thing that sprung to mind:

    Find the length of the string, find the length of the string without your word, divide that difference by the length of your word:

    Where A1 is your string and cheese is your word (can obviously point that at a cell instead):

    =(LEN(A1)-LEN(SUBSTITUTE(A1,"cheese","")))/LEN("cheese")
    
About

Avatar for pifko @pifko started