Code:
COUNTIFS(A:A,1,B:B,"J")
will do it, assuming you want the whole column. If you want specific ranges, do
Code:
COUNTIFS(A1:A254,1,B1:B254,"J")
Unfortunately, COUNTIFS() is new to Excel 2007, but there other ways round this...
1) Add an extra column (say column C) and put this formula in:
Code:
=IF(A1=1, IF(B1="J", 1, 0), 0)
and sum it to get your answer.
or
2) Make a pivot table, depending on what you're wanting from the information.
or
3) put the damned data in Access instead - it's better at doing things like this - and then you can get your answer from a query like
Code:
SELECT Count(*) AS the_answer FROM mydata WHERE col_A=1 AND col_B='J';
4) If you want something a bit more interesting, like the same count for each different letter, in Access you could do something like this:
Code:
SELECT col_B as the_letter, Count(*) AS positives
FROM mydata
WHERE col_A=1
GROUP BY col_B;
4) or you could do a pivot table in Access too! Not as silly as it sounds, since it's easier to filter and manipulate the pivot table with an Access query anyway.
For counting all the zeroes and giving overall totals
Code:
TRANSFORM Count(*)
SELECT col_B AS the_letter, Count(*) as all_results
FROM mydata
GROUP BY col_B
PIVOT col_A;
which will give you a table with each row having the letter, the total number of records, the count for 0 and the count for 1
Hope this helps,
Matt