ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Count cells containing text, multiple criteria (https://www.excelbanter.com/excel-programming/450303-count-cells-containing-text-multiple-criteria.html)

[email protected]

Count cells containing text, multiple criteria
 
I have names in A2:A5 (Joe, Jim, Jake Jones, Jeff Johnson) and birthdates in B2:B5(1980, 1980, 1980, 1981). In A1 is the name criteria (eg "Jake"), and in A2 is the birthdate criteria (eg "1980").

I would like to count the number of times a row satisfies both the name and birthdate criteria. In the case of looking for "Jake" and 1980, it would satisfy Jake Jones, 1980 which is in A4 and B4, and therefore return 1.

I'm attempting the formula:
=SUMPRODUCT((A2:10="*"&A1&"*")*(B2:K2=B1))

but the trouble is, I think, trying to use the wildcards in an array function, which apparently is no go. Is there a better way to do this?

Thanks for any help.

Claus Busch

Count cells containing text, multiple criteria
 
Hi,

Am Tue, 26 Aug 2014 17:59:51 -0700 (PDT) schrieb :

I'm attempting the formula:
=SUMPRODUCT((A2:10="*"&A1&"*")*(B2:K2=B1))


in a SUMPRODUCT formula the ranges must have the same dimension:
=SUMPRODUCT(--(A2:A10=A1),--(B2:B10=B1))

Try it with COUNTIFS:
=COUNTIFS(A2:A10,"*"&A1&"*",B2:B10,B1)


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional

[email protected]

Count cells containing text, multiple criteria
 
Awesome, I did not know about COUNTIFS!! Thanks for the help!


All times are GMT +1. The time now is 09:24 PM.

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