ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   countif for two ranges? (https://www.excelbanter.com/excel-programming/382415-countif-two-ranges.html)

[email protected]

countif for two ranges?
 
Example:

I'd like to use COUNTIF to alnalyze the following two ranges and come
up with a formula that would spit out how many times joe is green. And
then modify it for joe meeting a blue condition, mary meeting green,
blue, etc. Is this possible? From what I've been reading COUNTIF can't
compare two ranges? Is a macro the only way to go here?

Any help would be appreciated.


column A Column B
joe green
mary green
joe blue
joe blue
joe green
mary blue
joe green
mary green
mary green


Bernard Liengme

countif for two ranges?
 
=SUMPRODUCT(--(A1:A100="Joe"),--(B1:B100="green")
see
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

http://mcgimpsey.com/excel/formulae/doubleneg.html
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

wrote in message
oups.com...
Example:

I'd like to use COUNTIF to alnalyze the following two ranges and come
up with a formula that would spit out how many times joe is green. And
then modify it for joe meeting a blue condition, mary meeting green,
blue, etc. Is this possible? From what I've been reading COUNTIF can't
compare two ranges? Is a macro the only way to go here?

Any help would be appreciated.


column A Column B
joe green
mary green
joe blue
joe blue
joe green
mary blue
joe green
mary green
mary green




[email protected]

countif for two ranges?
 
absolutely perfect - you are a 1337 h4x0r
gracias


Bernard Liengme

countif for two ranges?
 
Thanks - I hope being a "1337 h4x0r" is a good thing!
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

wrote in message
oups.com...
absolutely perfect - you are a 1337 h4x0r
gracias





All times are GMT +1. The time now is 08:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com