ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   count if (https://www.excelbanter.com/excel-discussion-misc-queries/85633-count-if.html)

wc

count if
 
I have a problem I want to count with multiply parameters.
ex.
tp403 e
lp602 p
tp601 e
tp403 p

I want to count when column 1 is tp... and column 2 is e. I can count, but
i have a problem with using wildcard *.


Bob Phillips

count if
 
=SUMPRODUCT(--(LEFT(A1:A100,2)="tp"),--(B1:B100="e"))

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"wc" wrote in message
...
I have a problem I want to count with multiply parameters.
ex.
tp403 e
lp602 p
tp601 e
tp403 p

I want to count when column 1 is tp... and column 2 is e. I can count,

but
i have a problem with using wildcard *.




mrice

count if
 

If you make an extra column which concatentate the two fields (maybe
with an unusual separator for safety), you can then use the COUNTIF
function on this.

tp403 e tp403|e
lp602 p lp602|p
tp601 e tp601|e
tp403 p tp403|p


=COUNTIF(C1:C4,"tp*|e") gives the value of 2


--
mrice

Research Scientist with many years of spreadsheet development experience
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=536900



All times are GMT +1. The time now is 02:27 AM.

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