Countif

  • Thread starter Thread starter massi
  • Start date Start date
M

massi

Hi,
I have a table with several column and i want to use "countif" for 2
conditions.
=COUNTIF(A2:A5,"X") is the formula to use for one conditon in one
column.
I would like to use a formula like: =COUNTIF(A2:C5,"X","Y")
I have tried this formula but obviously doesn't work. any suggestion?
thanks a lot

Massimo
 
Try
=COUNTIF(A2:C5,"X")+COUNTIF(A2:C5,"Y")

or

=SUMPRODUCT(--(A2:C5="Y")+(--(A2:C5="X")))

VBA Noob
 
I have tried the formula =COUNTIF(A2:C5,"X")+COUNTIF(A2:C5,"Y") but
doesn't work. sumproduct instead is not the one i need as i am not
dealing only with number.

i'll try to explain better:
this is my table where i get the data from

status rev type
---------------------
X 1 dwg
X 1 dwg
X 2 doc
X 3 doc
Z 1 dwg
C 4 doc
A 2 dwg




this is the table where i would like the formula work for me:


dwg doc status
-----------------------
n n X
n n Z
n n C
n n A

where n is the result of the formula.

:confused:
 
I think I understand what you want :)

I am quite bad at explaning. So, I have attached an example with this
reply.
Basically, you need to create another column to merge the "type" and
"status" to get the countif to work.

Hope this helps :D


+-------------------------------------------------------------------+
|Filename: countif2.zip |
|Download: http://www.excelforum.com/attachment.php?postid=5122 |
+-------------------------------------------------------------------+
 
Back
Top