Thread: Count If ?
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Sukhjeet
 
Posts: n/a
Default Count If ?

Hi John
You could do it in 2 ways.
1. The simpler and easier one is to add a "helper column" C, while the
numbers - 20, 30 etc are in Column A1 to A8, and 3ES etc are in B1 to B8. In
C1, write a formula "=AND(A1=$F$1,B1=$F$2)" where cell F1 contains 20 and F2
contains 3ES. Drag the formula down.
In the cell where you want the result, write "=COUNTIF(C1:C8,TRUE)"
You will get the results.
2. In the results cell write "=SUM((A1:A8=F1)*(B1:B8=F2))". This has to be
an array formula, so please press the keys "SHIFT-CNTRL-ENTER instead of just
enter after typing the formula.
Regards
Sukhjeet

"JohnHill" wrote:


I've got 2 columns of data, let's say that they are as follows :-



20 3ES
21 3EM
30 8AS
20 8AS
30 3ES
20 3ES
50 9A
60 9B

I want to count the number of entries wher the values meet two
criteria. The criteria are defined by two cells.

Let's Say I key in 20 in the first look up cell and 3ES in the second
look up cell. The correct answer to the above is 2. That is the first
and the sixth lines meet both criteria.

Help please


--
JohnHill
------------------------------------------------------------------------
JohnHill's Profile: http://www.excelforum.com/member.php...o&userid=25171
View this thread: http://www.excelforum.com/showthread...hreadid=542357