> > One way:
>
[quoted text clipped - 3 lines]
>
> Can you explain this to me?
The asterisks mean "anything", so as long as the cell contains the
letters "word", it will return a result. For example, "words" and
"sword" and "swords" will also return a result.
The formula is saying "count the number of times "*word*" appears in
cell P3, then deduct it from 2.
So, if the cell does not contain "word", that is a zero count, so the
formula works out 2-0, which gives you a 2 if "word" is not present.
If the cell does contain "word", that is a one count, so the formula
works out 2-1, which gives you a 1 if "word" is present.
PhilD
--
<><
JE McGimpsey - 13 Jul 2007 12:27 GMT
> > > One way:
> >
[quoted text clipped - 10 lines]
> The formula is saying "count the number of times "*word*" appears in
> cell P3, then deduct it from 2.
Close, but not quite. COUNTIF() returns a count of the number of
*cells* in the range that meet the criterion (no matter how many times
within each cell), so COUNTIF(P3,"*word*") returns the number of cells
in the range P3 contain the text "word". Even if P3 contains
"wordwordword", COUNTIF will only return 1.
> So, if the cell does not contain "word", that is a zero count, so the
> formula works out 2-0, which gives you a 2 if "word" is not present.
>
> If the cell does contain "word", that is a one count, so the formula
> works out 2-1, which gives you a 1 if "word" is present.
Correct.