SumProduct help Multiple String Criteria

Kemidan2014

Board Regular
Joined
Apr 4, 2022
Messages
226
Office Version
  1. 365
Platform
  1. Windows
I am working on an export sheet for Access Query export so that i can graph some data. (access graphs can not handle what is needed)
I am working on the sheet in that holding all the formula tables to count for the graphs i need to produce.
I am stuck on the last table.

This table Columns which are Product GROUPS (meaning there can be anywhere between 1 and 5 part numbers that fall into that group.
The rows are Reasons for flow out. everything is text strings that i need to count up combinations of Part numbers & reason

Obviosly where i have 1 part number in a group i do a simple countifs and it adds up fine. Where i am losing my mind is where in the column that has up to 5 part numbers i typed out the part numbers above the group name in individual cells. I cant figure out how to get sumproduct to work correctly OR countifs, when i used countifs it always = zero which is not correct.

The table - Row 98 is simply my header row for the graph. i need to produce a stacked bar graph. it you look at column H youll see its not adding up right i should only have 1 under that column in Mis Sort row rest should be zeros but i have a 5 and some other numbers.

ComplaintMetricsQuery.xlsx
ABCDEFGHIJKLMNOPQ
93881 LH Filler Cap AssyCVT FSV
94878 LH CHC Camry2.5 Heater FSV
95881 LH CHC127 PST2.0 Heater FSV
96881 TCC878 LH CHC878 LH PST947 PST103 TCC No 2115 TCC No 2115 SuctionAEI FSV152 TCC No 2
97Why Ship by Part Model878 TCC878 RH CHC878 RH PST946 TCC No. 1946 OP946 PST103 TCC No 1115 TCC No 1115 WP ASATF FSV152 TCC No 1
98GR TCCGR CHC881 FCGR PSTTNGA TCCTNGA OPTNGA PST103 TCC115 TCC115 OP115 WP136 PSTFSV152 TCC152 OPTNGA OCV
994-Evils0000000000000000
100Missed VI0100002000000000
101VI NG0000000000000000
102SWI Not Followed0000000000000000
103SWI NG0000000000000000
104Poka-Yoke Malf0000000000000000
105No check in place0000000000000000
106Mis-Sort0000005100000000
107NTF0000000000000000
108Cannot detect0000002001000000
Data
Cell Formulas
RangeFormula
B99:B108,E99:E108,I99:J108,L99:L108,O99:O108B99=SUMPRODUCT(ISNUMBER(SEARCH(B$97,ComplaintMetricsQuery!$K:$K))*ISNUMBER(SEARCH(Data!$A99,ComplaintMetricsQuery!$H:$H))+ISNUMBER(SEARCH(B$96,ComplaintMetricsQuery!$K:$K))*ISNUMBER(SEARCH(Data!$A99,ComplaintMetricsQuery!$H:$H)))
C99:C108,H100:H108,N99:N108C99=SUMPRODUCT(ISNUMBER(SEARCH(C$97,ComplaintMetricsQuery!$K:$K))*ISNUMBER(SEARCH(Data!$A99,ComplaintMetricsQuery!$H:$H))+ISNUMBER(SEARCH(C$96,ComplaintMetricsQuery!$K:$K))*ISNUMBER(SEARCH(Data!$A99,ComplaintMetricsQuery!$H:$H))+ISNUMBER(SEARCH(C$95,ComplaintMetricsQuery!$K:$K))*ISNUMBER(SEARCH(Data!$A99,ComplaintMetricsQuery!$H:$H))+ISNUMBER(SEARCH(C$94,ComplaintMetricsQuery!$K:$K))*ISNUMBER(SEARCH(Data!$A99,ComplaintMetricsQuery!$H:$H))+ISNUMBER(SEARCH(C$93,ComplaintMetricsQuery!$K:$K))*ISNUMBER(SEARCH(Data!$A99,ComplaintMetricsQuery!$H:$H)))
D99:D108,K99:K108,M99:M108,P99:Q108D99=COUNTIFS(ComplaintMetricsQuery!$K:$K,Data!D$98,ComplaintMetricsQuery!$H:$H,Data!$A99)
F99:G108F99=COUNTIFS(ComplaintMetricsQuery!$K:$K,Data!F$97,ComplaintMetricsQuery!$H:$H,Data!$A99)
H99H99=SUMPRODUCT(ISNUMBER(SEARCH(H$97,ComplaintMetricsQuery!$K:$K))*ISNUMBER(SEARCH(Data!$A99,ComplaintMetricsQuery!$H:$H))+ISNUMBER(SEARCH(H$96,ComplaintMetricsQuery!$K:$K))*ISNUMBER(SEARCH(Data!$A99,ComplaintMetricsQuery!$H:$H))+ISNUMBER(SEARCH(H$95,ComplaintMetricsQuery!$K:$K))*ISNUMBER(SEARCH(Data!$A99,ComplaintMetricsQuery!$H:$H)))



The source
DocTypeSupplierCodeOfficialIssuanceDatePartTypeNAMCQtyWhyMakeWhyShipDefectTypeProcessTypeAisinName
QPR0101-62/3/2023OPTMMAL0Design NG4-EvilsDamageAS984 OP
QPR0101-61/20/2023OPTMMWV1Chg Pt Not ControlledCannot detectFunctionAS115 OP
QPR0101-62/16/2023CHCTMMK-PWT0Process Design NGMissed VIFitRSN-AS878 RH CHC
QPR0101-62/14/2023PSTTMMWV0Equipment NGMis-SortDamagePST-MA947 PST
QPR0101-62/10/2023TCCTMMAL0Human ErrorMis-SortDimensionMA103 TCC No 1
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Is "The source" a worksheet named "ComplaintMetricsQuery" if not you should post some of that data as well.
And if it is... can you please give the Column Headers and row numbers in "the Source" as your formulas from the top mini workbook ("Data")refer to "ComplaintMetricsQuery"?
 
Upvote 0
Awoo, yes it is the worksheet named that in the same book.

ComplaintMetricsQuery.xlsx
ABCDEFGHIJK
1DocTypeSupplierCodeOfficialIssuanceDatePartTypeNAMCQtyWhyMakeWhyShipDefectTypeProcessTypeAisinName
2QPR0101-62/3/2023OPTMMAL0Design NG4-EvilsDamageAS984 OP
3QPR0101-61/20/2023OPTMMWV1Chg Pt Not ControlledCannot detectFunctionAS115 OP
4QPR0101-62/16/2023CHCTMMK-PWT0Process Design NGMissed VIFitRSN-AS878 RH CHC
5QPR0101-62/14/2023PSTTMMWV0Equipment NGMis-SortDamagePST-MA947 PST
6QPR0101-62/10/2023TCCTMMAL0Human ErrorMis-SortDimensionMA103 TCC No 1
ComplaintMetricsQuery
 
Upvote 0
@Kemidan2014
First, I made your formula a little cleaner by distributing the check in column H.
But, the second problem is that since you have a "" in row93, when you search for "" in the string, it gets a true with the is number function.
put an edit in front of that as well. I'll keep tooling around. but put this is row 99:

=SUMPRODUCT(
ISNUMBER(SEARCH(Data!$A99,ComplaintMetricsQuery!$H$1:$H$6))*
(
(--ISNUMBER(SEARCH(H$97,ComplaintMetricsQuery!$K$1:$K$6)))+
(--ISNUMBER(SEARCH(H$96,ComplaintMetricsQuery!$K$1:$K$6)))+
(--ISNUMBER(SEARCH(H$95,ComplaintMetricsQuery!$K$1:$K$6)))+
(--ISNUMBER(SEARCH(H$94,ComplaintMetricsQuery!$K$1:$K$6)))+
(--ISNUMBER(SEARCH(H$93,ComplaintMetricsQuery!$K$1:$K$6)))
)
)
 
Upvote 0
Also, you omitted Row98 in your big formula. but try this:
=SUMPRODUCT(
ISNUMBER(SEARCH(Data!$A99,ComplaintMetricsQuery!$H$1:$H$6))*
(
($H$98<>"")*(--ISNUMBER(SEARCH(H$98,ComplaintMetricsQuery!$K$1:$K$6)))+
($H$97<>"")*(--ISNUMBER(SEARCH(H$97,ComplaintMetricsQuery!$K$1:$K$6)))+
($H$96<>"")*(--ISNUMBER(SEARCH(H$96,ComplaintMetricsQuery!$K$1:$K$6)))+
($H$95<>"")*(--ISNUMBER(SEARCH(H$95,ComplaintMetricsQuery!$K$1:$K$6)))+
($H$94<>"")*(--ISNUMBER(SEARCH(H$94,ComplaintMetricsQuery!$K$1:$K$6)))+
($H$93<>"")*(--ISNUMBER(SEARCH(H$93,ComplaintMetricsQuery!$K$1:$K$6)))
)
)

Excel Formula:
=SUMPRODUCT(
ISNUMBER(SEARCH(Data!$A99,ComplaintMetricsQuery!$H$1:$H$6))*
(
($H$98<>"")*(--ISNUMBER(SEARCH(H$98,ComplaintMetricsQuery!$K$1:$K$6)))+
($H$97<>"")*(--ISNUMBER(SEARCH(H$97,ComplaintMetricsQuery!$K$1:$K$6)))+
($H$96<>"")*(--ISNUMBER(SEARCH(H$96,ComplaintMetricsQuery!$K$1:$K$6)))+
($H$95<>"")*(--ISNUMBER(SEARCH(H$95,ComplaintMetricsQuery!$K$1:$K$6)))+
($H$94<>"")*(--ISNUMBER(SEARCH(H$94,ComplaintMetricsQuery!$K$1:$K$6)))+
($H$93<>"")*(--ISNUMBER(SEARCH(H$93,ComplaintMetricsQuery!$K$1:$K$6)))
)
)
 
Upvote 0
yes as i explained Row 98 so its intentionally omitted that verbage is not used in my Access tables. it will only be used for the graph, rows 93 to 97 will be used for counting.

Oooh i didnt think of using Not <> thats clever i knew i had a syntax issue
 
Upvote 0
so, taking that line out:
=SUMPRODUCT(
ISNUMBER(SEARCH(Data!$A99,ComplaintMetricsQuery!$H$1:$H$6))*
(
($H$97<>"")*(--ISNUMBER(SEARCH(H$97,ComplaintMetricsQuery!$K$1:$K$6)))+
($H$96<>"")*(--ISNUMBER(SEARCH(H$96,ComplaintMetricsQuery!$K$1:$K$6)))+
($H$95<>"")*(--ISNUMBER(SEARCH(H$95,ComplaintMetricsQuery!$K$1:$K$6)))+
($H$94<>"")*(--ISNUMBER(SEARCH(H$94,ComplaintMetricsQuery!$K$1:$K$6)))+
($H$93<>"")*(--ISNUMBER(SEARCH(H$93,ComplaintMetricsQuery!$K$1:$K$6)))
)
)
 
Upvote 0
Solution
yes as i explained Row 98 so its intentionally omitted that verbage is not used in my Access tables. it will only be used for the graph, rows 93 to 97 will be used for counting.

Oooh i didnt think of using Not <> thats clever i knew i had a syntax issue
you said it was the header, not that it is to be omitted. But, i hope the formula still works. Does it?
 
Upvote 0
It does, Does Sumproduct prohibit the use of entire column? the query will output dynamic range over time.
 
Upvote 0
It does, Does Sumproduct prohibit the use of entire column? the query will output dynamic range over time.
no, i used the few cells i reference to make building the formula easier by seeing how the arrays calculate inside the formula (the F9 trick).

But, it has often been stated that referencing a huge range that will never be used can use up resources during calculations. It is one reason why tables are helpful as the ranges expand with the tables.
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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