Countif?

T

teeb

I'm looking for some help with the following;

What I want to do in another cell is look up a range on column A and if
its "text 1" count the number of "text 2" in column B.

ie
A1 B1
Text 1 Y
Text 1 N
Text 2 Y
Text 2 Y

This would result in

For text 1 with Y = 1
For text 1 with N = 1
For text 2 with Y = 1
For text 2 with N = 0

Any help would be appreciated.

Thanks, Teeb
 
D

Dave Peterson

You may want to look at Data|Pivottable to get the summary all at once.

But you could use a formula like:

=sumproduct(--(a1:a10="Text 1"),--(b1:b10="y"))

extend the ranges, but don't use the whole column.

=sumproduct() likes to work with numbers.

The -- converts trues and falses to 1's and 0's.
 
T

teeb

Thanks for the quick reply Dave.

I've not explained this properly:

I'm looking for a cell that will add up the number of "X" in column B
(or range in B) , when the same row number in column A = "Y"

Cheers, Teeb
 
B

Bob Phillips

That seems quite different than last time, but maybe

=sumproduct(--(a1:a10="Y"),--(b1:b10="X"))

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Top