COUNTIF

aka_krakur

Active Member
Joined
Jan 31, 2006
Messages
438
I need to somehow fix this formula to work. It's not working so far.
Here is a sample data set first:
Book2
ABCD
1MONTH_SORTINCIDENT_KEYPRODUCT_FAMILYREPORTED_DEV_CLARIFICATION
27/1/200677628-1-1Product1X100-N/A;
37/1/200677651-1-1Product1X100-N/A;
47/1/200677653-1-2Product1X100-N/A;
57/1/200677655-1-1Product11158-N/A;1536-Handle;
67/1/200677656-1-2Product1X100-N/A;
77/1/200677656-1-3Product1X100-N/A;
87/1/200677661-1-2Product22578-Stent;
97/1/200677662-1-1Product1X100-N/A;
107/1/200677676-1-1Product1X100-N/A;
117/1/200677684-1-1Product1X100-N/A;
127/1/200677686-1-1Product11528-N/A;2203-IrregularAppearance;1670-IncorrectRemoval;
137/1/200677692-1-1Product1X100-N/A;
147/1/200677692-1-2Product2X100-N/A;
157/1/200677693-1-1Product1X100-N/A;
167/1/200677759-1-1Product21158-FilterBasket;
178/1/200677764-1-2Product1X100-N/A;
188/1/200677768-1-1Product32524-Lesion;
198/1/200677778-1-1Product1X100-N/A;
208/1/200677781-1-1Product1X100-N/A;
218/1/200677799-1-1Product1X100-N/A;
228/1/200677800-1-1Product12593-Failure;
238/1/200677800-1-2Product12593-Failure;
248/1/200677800-1-3Product12593-Failure;
258/1/200677831-1-1Product1X100-N/A;
268/1/200677831-1-2Product2X100-N/A;
278/1/200677832-1-1Product1X100-N/A;
288/1/200677838-1-1Product1X100-N/A;
298/1/200677842-1-1Product12524-NoPI-NoInformation;
308/1/200677848-1-1Product1X100-N/A;
318/1/200677848-1-2Product22578-N/A;
328/1/200677852-1-1Product11339-Shaft;2578-DeviceComponent;
338/1/200677878-1-2Product1X100-N/A;
343/1/200677880-1-1Product21487-UnabletoFlush;2524-Lesion;
359/1/200677914-1-1Product22524-Lesion;
369/1/200677914-1-2Product1X100-N/A;
379/1/200677916-1-1Product1X100-N/A;
389/1/200677974-1-1Product32524-Lesion;
399/1/200678015-1-2Product1X100-N/A;
409/1/200678020-1-1Product31393-N/A;1528-FilterBasket;
419/1/200678036-1-2Product22578-Stent;
429/1/200678047-1-3Product11158-N/A;1670-ExcessiveForce;1528-Vessel;1339-Shaft;
439/1/200678047-1-4Product31586-Core;2578-N/A;
449/1/200678048-1-2Product1X100-N/A;
459/1/200678095-1-2Product1X100-N/A;
469/1/200678105-1-2Product11069-Shaft;1670-UseAfterDamage;1339-Shaft;
479/1/200678107-1-1Product31586-Tip;
489/1/200678143-1-1Product1X100-N/A;
499/1/200678145-1-1Product1X100-N/A;
509/1/200678162-1-2Product1X100-N/A;
519/1/200678170-1-1Product32578-DeviceComponent;
529/1/200678176-1-1Product1X100-N/A;
539/1/200678179-1-1Product32524-Lesion;
549/1/200678195-1-1Product31601-Tip;
Sheet1
 
Yeah, I'm having a lot more luck with that formula now.

Couple Questions.

When I 1st posted this I made the Product_Family seem like it didn't matter too much.
It's a lot more complex than Product1, Product2, etc.
I can have one that's like Product1-Clinical; Product1-Test but I may want to pull all Product1's or I may want only Product1-Clinical.

So is there a way to do a search on that as well. Instead of just putting $C$2:$C$23="Product1" is there a way to search like we did with the failure codes.

2nd question:
not all failure codes are numbers. I may have a time where the failure code is text. Not sure if it's as simple as changing the ISNUMBER(SEARCH... to ISTEXT(SEARCH.

Please let me know.

This formula's working great other than that though.

Thanks,
David
 
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Yeah, I'm having a lot more luck with that formula now.

Couple Questions.

When I 1st posted this I made the Product_Family seem like it didn't matter too much.
It's a lot more complex than Product1, Product2, etc.
I can have one that's like Product1-Clinical; Product1-Test but I may want to pull all Product1's or I may want only Product1-Clinical.

So is there a way to do a search on that as well. Instead of just putting $C$2:$C$23="Product1" is there a way to search like we did with the failure codes.

=SUMPRODUCT(--($A$2:$A$23-DAY($A$2:$A$23)+1="1-Aug-06"+0),--ISNUMBER(SEARCH("Product1-",$C$2:$C$23)),--(MMULT(ISNUMBER(SEARCH({"1158","1484","1536","1157"},$D$2:$D$23))+0,ROW($D$2:INDEX($D$2:$D$1200,COLUMNS({"1158","1484","1536","1157"})))^0)>0))

2nd question:
not all failure codes are numbers. I may have a time where the failure code is text. Not sure if it's as simple as changing the ISNUMBER(SEARCH... to ISTEXT(SEARCH.

Please let me know.

ISNUMBER check is required for SEARCH returns numbers. The search substrings list can be expanded with other items like in:

{"1158","1484","1536","1157","FRAN"}

This formula's working great other than that though.

Thanks,
David

You are welcome.
 
Upvote 0
One last & hopefully small easy question:

I have times when the product family is very similar.
For instance.
1 Product Family = RX Acculink
2 Product Family = RX Acculink 3-IN-1

There are times when I only want to count RX Acculink, times when I only want to count Acculink 3-IN-1 and other times when I want to count them all together.
Any ideas?
 
Upvote 0
Okay, so far I'm having more luck with NBVC (the guy with the smurf).
...
I tried but it didn't work. And how about if there is only 1 failure code. Does it work to leave the rest of them blank and it will only search for the 1?....

Thanks

Mine will work if you had one failure code..or two...or three....or four. As I had said you can easily expand it to allow more failure codes.
 
Upvote 0
One last & hopefully small easy question:

I have times when the product family is very similar.
For instance.
1 Product Family = RX Acculink
2 Product Family = RX Acculink 3-IN-1

There are times when I only want to count RX Acculink, times when I only want to count Acculink 3-IN-1 and other times when I want to count them all together.
Any ideas?

You need something more to distinguish between them... For example:

RX Acculink -
RX Acculink 3-IN-1 -

would work.

Otherwise, you'll need to substract the result for RX Acculink 3-IN-1 from the result for RX Acculink.
 
Upvote 0
Yeah, I thought about the subtraction thing this weekend. That's what I'm going to have to do, because all the Product Families come from an Oracle Database that I query in to Excel, that the whole point of these macros and formulas and such is to automate the process and take away all the manual processes.

Thanks for the ideas
 
Upvote 0
More help with sumproduct formula

Once again I have stumbled with figuring out how to use this formula when I have two Products that are similar in name:

Product 1 = Accunet
Product 2 = Accunet 3-IN-1

Here's my formula I've been using successfully up until today:
Code:
=IF(ISERROR(SUMPRODUCT(--(MMULT(--ISNUMBER(SEARCH($C19:$F19,ReportableQuery!$Z$19:$Z$893))+0,ROW(ReportableQuery!$Z$19:INDEX(ReportableQuery!$Z$19:$Z$893,COLUMNS($C19:$F19)))^0)>0),--(MMULT(--ISNUMBER(SEARCH($B19,ReportableQuery!$L$19:$L$893))+0,ROW(ReportableQuery!$L$19:INDEX(ReportableQuery!$L$19:$L$893,COLUMNS($B19)))^0)>0),--(ReportableQuery!$I$19:$I$893-DAY(ReportableQuery!$I$19:$I$893)+1=N$3))),0,(SUMPRODUCT(--(MMULT(--ISNUMBER(SEARCH($C19:$F19,ReportableQuery!$Z$19:$Z$893))+0,ROW(ReportableQuery!$Z$19:INDEX(ReportableQuery!$Z$19:$Z$893,COLUMNS($C19:$F19)))^0)>0),--(MMULT(--ISNUMBER(SEARCH($B19,ReportableQuery!$L$19:$L$893))+0,ROW(ReportableQuery!$L$19:INDEX(ReportableQuery!$L$19:$L$893,COLUMNS($B19)))^0)>0),--(ReportableQuery!$I$19:$I$893-DAY(ReportableQuery!$I$19:$I$893)+1=N$3))))
Where C19:F19 are the failure codes to look up.
B19 contains the Product Name.
Here's where it gets tricky for me.
Scenario:
Product Accunet
Failure Codes 2578 - clarifier1, & 2578 - clarifier2
So when this formula goes and searches the ReportableQuery worksheet (Z19:Z893); it returns finds even for Accunet 3-IN-1.
I don't need/want these counted.

Can someone think of something to resolve this.
I tried doing a sum formula where I subtract the above formula - and then retype the entire formula and force the 2nd formula to look up only Accunet 3-IN-1. But Excel doesn't like it...too long of a formula.

PLEASE HELP!!!
 
Upvote 0

Forum statistics

Threads
1,215,681
Messages
6,126,192
Members
449,298
Latest member
Jest

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top