Countif?

  • Thread starter Thread starter teeb
  • Start date Start date
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
 
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.
 
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
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top