countif

  • Thread starter Thread starter Marilyn
  • Start date Start date
M

Marilyn

I am needing to count how many cells have the letter P in
them. The cells are not toegher in a series. How can I
do a COUNTIF on cells that are random on the sheet?
Thank you.
 
It does not seem possible for countif to read an array of
non contiguous cells therefore either combine countif
statements eg
=COUNTIF(D9,"=p")+COUNTIF(D11,"=p")+COUNTIF(D20,"=*p*")

Note, wildcards do appear to work as in COUNTIF
(D20,"=*p*") where D20 will be counted if a p is any part
of its text content.

Alternatively previous post by Len Meads:

To count the number of entries in more than one range that
exceeds the value in a referenced cell, try the following.

Assume the ranges are Y4:Y500, Z4:Z500, and the referenced
cell is A1.
Name the range containing contiguous cells Y4:Z500, say
Group.
Use =COUNTIF(Group,">"&A1)

Assume the ranges are X4:X500, Z4:Z500, and the referenced
cell is A1.
Use =COUNTIF(X4:X500,">"&A1)+COUNTIF(Z4:Z500,">"&A1)

It does not seem possible for COUNTIF to use a single
named range composed of noncontiguous cells.

Paul Moles
 
Back
Top