Count cells except...

J

jmj713

I'm trying different tricks with COUNTIF but nothing seems to work. I'm
trying to get Excel to give me a count of cells that contain data, except
those that contain either X or Y.
 
J

John C

Assuming that your count is text or numeric, you could try:
=COUNTA(A2:A10)-COUNTIF(A2:A10,"x")-COUNTIF(A2:A10,"y")
If it's only numeric, you could change the first function from COUNTA to COUNT
 
T

T. Valko

Is this related to your other post?
trying to get Excel to give me a count of cells that contain
data, except those that contain either X or Y.

In your other post you made it sound like there were only X or Y in the
range.

Perhaps you should explain in more detail what you want. Tells us where this
data is. Now it sounds like there is other data in the range besides X and
Y. If you want percentages, are there any empty cells in the range and
should they be considered or ignored?
 
J

jmj713

It is.

I used John's formula, slightly edited it, and now I solved both problems.
Thank you both.
 
Top