Count if 2 conditions are true

G

Guest

Hi folks,
This ought to be easy, but I can't get it to work

In range J13:J110 I have various city names where a new customer has been
added. There can be multiple occurances of each city as we go down the colum
range of J13:j110. So there may be 5 Chicago, 2 Denver etc.
In range L13:L110 I have either "Y" or Blank in front of the of the cities.

I want to write a formula that for each city, it counts how many "Y" there
are in range L13:L110.

Any suggestions please?

Thanks
 
A

Aladin Akyurek

=SUMPRODUCT(--($J$13:$J$110=X2),--($L$3:$L$110="Y"))

where X2 houses a city of interest.
Hi folks,
This ought to be easy, but I can't get it to work

In range J13:J110 I have various city names where a new customer has been
added. There can be multiple occurances of each city as we go down the colum
range of J13:j110. So there may be 5 Chicago, 2 Denver etc.
In range L13:L110 I have either "Y" or Blank in front of the of the cities.

I want to write a formula that for each city, it counts how many "Y" there
are in range L13:L110.

Any suggestions please?

Thanks

--

[1] The SumProduct function should implicitly coerce the truth values to
their Excel numeric equivalents.
[2] The lookup functions should have an optional argument for the return
value, defaulting to #N/A in its absence.
 
G

Guest

Thank you Aladin.
This is what I was looking for

Aladin Akyurek said:
=SUMPRODUCT(--($J$13:$J$110=X2),--($L$3:$L$110="Y"))

where X2 houses a city of interest.
Hi folks,
This ought to be easy, but I can't get it to work

In range J13:J110 I have various city names where a new customer has been
added. There can be multiple occurances of each city as we go down the colum
range of J13:j110. So there may be 5 Chicago, 2 Denver etc.
In range L13:L110 I have either "Y" or Blank in front of the of the cities.

I want to write a formula that for each city, it counts how many "Y" there
are in range L13:L110.

Any suggestions please?

Thanks

--

[1] The SumProduct function should implicitly coerce the truth values to
their Excel numeric equivalents.
[2] The lookup functions should have an optional argument for the return
value, defaulting to #N/A in its absence.
 

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

Top