Peter Kirkpatrick <pakirk@[EMAIL PROTECTED]
> writes:
> In article <ymimyzbs4sr.fsf@[EMAIL PROTECTED]
>, Thomas A. Russ
> <tar@[EMAIL PROTECTED]
> wrote:
>
> > Peter Kirkpatrick <pakirk@[EMAIL PROTECTED]
> writes:
> >
> > > Is there any way to make COUNTIF look for an occurance of a letter
in a
> > > cell rather than taking the entire cell as the condition? I am
trying
> > > to count the number of cells containing "H" in a range of cells
> > > containing e.g. LTH, BSH, TBH. I would like to count these cells and
> > > return "3". So far I can only get "0" because none of he cells has H
> > > alone.
> >
> > Use wildcards:
> >
> > =COUNTIF(a:b, "*H*")
> >
> > where a:b is your data table.
>
> Thanks, that solved the problem. Is there a way to count occurrences in
> noncontiguous groups of cells?
Not that I'm aware of. I don't think you can use a non-contiguous
selection for the first argument to COUNTIF. Of course, if there aren't
too many regions, you could always combine multiple COUNTIF functions.
If things get a bit more complicated, you might need to look at the
database functions instead, and set up your data as a database.
--
Thomas A. Russ, USC/Information Sciences Institute


|