View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave F Dave F is offline
external usenet poster
 
Posts: 2,574
Default COUNTIF with multiple conditions?

Just do: =IF(COUNTIF([range],"X")=1,"only one X","other")

Dave
--
Brevity is the soul of wit.


"Barb Reinhardt" wrote:

This looks like a sumproduct question to me, but I'm not sure it can handle
26 different conditions.

=SUMPRODUCT(--(A1:A100="X"),--(B1:B100="X"),--(C1:C100="X")) would give you
the number of rows that only have X in them in columns A-C.

"Eric" wrote:

(Note: I also posted this on Excel / General questions. I hope I'm not
violating a rule by double-posting.)

I've got a table A2:Z100, with X's in some of the cells. A row may have one
or multiple Xs. I'm trying to find the number of rows which are "pureplays",
which is defined as a row with only one X.

For each column, I'd like to count the number of pureplays for that column
only, and put that value in the top row. So, for example, C1 would count the
number rows that have contain one X only and that X is in column C.

(I can't figure out how to do it with COUNTIF. A formula
COUNTIF(C2:C100,"X") will count the number of Xs in column C, but it's not
limited to the rows containing only one X.)

Any ideas??

Thanks.