ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Count string IF..... (https://www.excelbanter.com/excel-worksheet-functions/154915-count-string-if.html)

Coley

Count string IF.....
 
I am trying to count a 3 digit embeded data string IF....

NAME DATA_STRING
Joe WAPDATMM4RT1RRR
Susan WAPDATPLBMM5UDF
John DATPLBINSRBTMM6
Joe WAPUDARBTRRRMM4

I can count the strings with...
=SUM(COUNTIF(B2:B5,"*WAP*"),COUNTIF(B2:B5,"*RBT*") ,COUNTIF(B2:B5,"*MM4*"))
result (7)
I need the result IF A2:A5=Joe result (5)
I have stared at SUMPRODUCT long enough....H E L P !

Max

Count string IF.....
 
One way:
=SUMPRODUCT((ISNUMBER(FIND({"WAP","RBT","MM4"},B2: B5)))*(A2:A5="Joe"))

Replace FIND with SEARCH if you don't need it to be case sensitive
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Coley" wrote:
I am trying to count a 3 digit embeded data string IF....

NAME DATA_STRING
Joe WAPDATMM4RT1RRR
Susan WAPDATPLBMM5UDF
John DATPLBINSRBTMM6
Joe WAPUDARBTRRRMM4

I can count the strings with...
=SUM(COUNTIF(B2:B5,"*WAP*"),COUNTIF(B2:B5,"*RBT*") ,COUNTIF(B2:B5,"*MM4*"))
result (7)
I need the result IF A2:A5=Joe result (5)
I have stared at SUMPRODUCT long enough....H E L P !


Coley

Count string IF.....
 
OUTSTANDING! Not sure why it works but it does. Thanks!

"Max" wrote:

One way:
=SUMPRODUCT((ISNUMBER(FIND({"WAP","RBT","MM4"},B2: B5)))*(A2:A5="Joe"))

Replace FIND with SEARCH if you don't need it to be case sensitive
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Coley" wrote:
I am trying to count a 3 digit embeded data string IF....

NAME DATA_STRING
Joe WAPDATMM4RT1RRR
Susan WAPDATPLBMM5UDF
John DATPLBINSRBTMM6
Joe WAPUDARBTRRRMM4

I can count the strings with...
=SUM(COUNTIF(B2:B5,"*WAP*"),COUNTIF(B2:B5,"*RBT*") ,COUNTIF(B2:B5,"*MM4*"))
result (7)
I need the result IF A2:A5=Joe result (5)
I have stared at SUMPRODUCT long enough....H E L P !


Max

Count string IF.....
 
welcome, Coley. glad it helped.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Coley" wrote in message
...
OUTSTANDING! Not sure why it works but it does. Thanks!




Harlan Grove[_2_]

Count string IF.....
 
"Max" wrote...
One way:
=SUMPRODUCT((ISNUMBER(FIND({"WAP","RBT","MM4"},B2 :B5)))*(A2:A5="Joe"))

....

Another way, shorter but an array formula,

=COUNT(FIND({"WAP","RBT","MM4"},B2:B5)/(A2:A5="Joe"))




All times are GMT +1. The time now is 02:55 PM.

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