The most pedestrian solution to your problem (tested in Excel and Google Docs) is to simply add the result of several countif formulas:
=COUNTIF(B5:O5, "*yes*") + COUNTIF(B5:O5, "*no*")
This expression will count the total number of cells with yes or no. It will double count the cell with "yesno" or "noyes", since it matches both expressions. You can try to pull the doubles with
=COUNTIF(B5:O5, "*yes*") + COUNTIF(B5:O5, "*no*") - COUNTIF(B5:O5, "*no*yes*") - COUNTIF(B5:O5, "*yes*no*")
But it will still cause you problems with a string like noyesno .
However, Google Docs has a pretty tricky trick that might just be a hint of the solution you're looking for:
=COUNTA(QUERY(A1:A9, "select A where A matches '(.*yes.*)|(.*no.*)'"))
The QUERY function is similar to the mini-database thing. In this case, he looks at the table in the range A1:A9 and selects only the elements in column A, where the corresponding element in the column A matches (in the meaning of the word preg regex ) is the next expression - in this case, "everything follows yes , after followed by something, or anything followed by no , followed by something. " In the simple example that I did, it is considered yesnoyes only once, which does exactly what you are asking for (I think ...)
Now your range of B5:O5 has a width of several columns and only one row; which makes it harder to use the QUERY trick. Something more or less elegant (but it works regardless of the shape of the range):
=countif(arrayformula(isnumber(find("yes",A1:A9))+isnumber(find("no",A1:A9))),">0")
The sum of the isnumber functions acts as an OR element - unfortunately, the regular OR function does not work for individual elements of the array. As before, it finds cells that contain yes or no, and counts those that contain one of these lines contained inside.