View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default how to count occurences of word in spreadsheet formula

If you want the count of cells that contain dog (e.g., "a dog-eat-dog
world" counts as 1, not 2):

=COUNTIF(A1:A100,"*dog*")

If "dog-eat-dog" should count twice:

=SUMPRODUCT(LEN(A1:A100) - LEN(SUBSTITUTE(A1:A100, "dog", ""))) /
LEN("dog")

In article ,
JBW wrote:

I need to count the number of times specific words appear in a sheet , I'm
not having much luck on my own as the word might be within the cell but not
constitute the whole contents.

i.e looking for the word DOG in cell containing "the dog sat down"