SUMIFS filtering on dotline

mporter785

New Member
Joined
Jun 14, 2022
Messages
21
Office Version
  1. 365
Platform
  1. Windows
forum_ex.xlsx
ABCDEFGHIJ
1DescritptionMaterial NumberEXCEL DESCRIPTIONProd_TypeProd_Cat.Time SavedNumber w/0 dotlineNumber with DotlineTime Saved (W/o) Time Save With
2MD20 SS HousingsV353378.B01HSG,MD20,MACH,304HOUSINGMD691854108
3MD20 GI Housings IndiaV353377.B01HSG,MD20,MACH,GIHOUSINGMD3234769141
Airlocks
Cell Formulas
RangeFormula
G2G2=SUM(SUMIFS(sab_prod!F:F,sab_prod!G:G,"*MD20 AIR*",sab_prod!M:M,{"*SS*","*304*","*316*"},sab_prod!B:B,"<>*.*",shipact,">="&Airlocks!$L$3,shipact,"<="&Airlocks!$L$4,cancel1,"FALSE"))
H2H2=SUM(SUMIFS(sab_prod!F:F,sab_prod!G:G,"*MD20 air*",sab_prod!M:M,{"*SS*","*304*","*316*"},sab_prod!J:J,">="&Airlocks!$L$3,sab_prod!J:J,"<="&Airlocks!$L$4,cancel1,"FALSE"))
I2:I3I2='offloaded parts.xlsx'!TBL_SUM[@[Time Saved]]*'offloaded parts.xlsx'!TBL_SUM[@[Number w/0 dotline]]
J2:J3J2='offloaded parts.xlsx'!TBL_SUM[@[Time Saved]]*'offloaded parts.xlsx'!TBL_SUM[@[Number with Dotline]]
G3G3=SUM(SUMIFS(sab_prod!F:F,sab_prod!G:G,"*MD20 AIR*",sab_prod!M:M,{"*GI*","*CS*"},sab_prod!B:B,"<>*.*",shipact,">="&Airlocks!$L$3,shipact,"<="&Airlocks!$L$4,cancel1,"FALSE"))
H3H3=SUM(SUMIFS(sab_prod!F:F,sab_prod!G:G,"*MD20 air*",sab_prod!M:M,{"*GI*","*CS*"},sab_prod!J:J,">="&Airlocks!$L$3,sab_prod!J:J,"<="&Airlocks!$L$4,cancel1,"FALSE"))
Named Ranges
NameRefers ToCells
cancel1=sab_prod!$R:$RG2:H3
shipact=sab_prod!$Q:$QG2:G3



job numberColumn1itemplantcustomerqtydescriptiondeptship-datejob-plnshp-plnPricemch-matmch-hsgmch-eplmch-rtrship-actcancelmch-cmplepl-stockrtr-stockmisc-stockedate
11004616771010SABWESTLAKE POLYMERS LP1 MD20 AIRLOCKM/S4/8/20224/1/20228097SSSSSP XMD20,SS,OE,8VN,FR8,C14/7/2022 0:00FALSETRUETRUETRUETRUEApril 2022
11004643891010SABJOHNSON MATTHEY PROCESS1 MD20 AIRLOCKM/S4/8/20224/1/202211058304L304L XSP CP 304L XMD20,SS,CE,8VN,FR8,SPCL4/14/2022 0:00FALSETRUETRUETRUETRUEApril 2022
11004645701010SABHEARTLAND FOOD PRODUCTS1 MD20 AIRLOCKM/S5/13/20225/6/20229628SSSS VNT XSP XMD20,SS,OE,8VN,ADJ32,CG80,SPCL 6-85/18/2022 0:00FALSETRUETRUETRUETRUEMay 2022
11004646551010SABEMS CHEMIE NORTH AMERICA INC1 MD20 AIRLOCKM/S4/8/20224/1/20226550SSSSSPMD20,SS,OE,8VN,FR16,C14/7/2022 0:00FALSETRUETRUETRUETRUEApril 2022
11004658102020SABSOUTHWIRE MC CABLE1 MD20 AIRLOCKM/S5/13/20225/6/202211484SSSSSP XMD20,304L,OE,8VN,FR8,CG24,RV,C15/11/2022 0:00FALSETRUETRUETRUETRUEMay 2022
11004658983030SABSPECTRUM BRANDS PET GROUP INC1 MD20 AIRLOCKM/S6/3/20226/1/20227362SSSSSP XMD20,304L,OE,8VN,FR8,C1FALSETRUETRUETRUETRUEJune 2022
11004680551010SABLANXESS CORPORATION1 MD20 AIRLOCKM/S5/27/20225/20/20229516316SS316SS XSP XMD20,316,OE,8VN,FR8,C15/23/2022 0:00FALSETRUETRUETRUETRUEMay 2022
11004680881010SABICL SPECIALTY PRODUCTS INC1 MD20 AIRLOCKM/S7/1/20226/24/202216240SSSSSP CPRETURN-NEDOXFALSEFALSEFALSEFALSETRUEJune 2022
11004693571010SABDANISCO1MD20 AIRLOCK DANISCOM/S5/20/20225/13/20227848SSSS VNT PORT XSP CPXMD20,.304L,CE,8VN,FR16,CG80,C15/23/2022 0:00FALSETRUETRUETRUETRUEMay 2022
11004713501010SABHEARTLAND FOOD PRODUCTS1MD20 AIRLOCK HEARTLAND PET FOODM/S6/10/20226/3/202210037SSSSSP XMD20,304L,OE,8VN,FR8,CG80,CW,C1FALSETRUETRUETRUETRUEJune 2022
11004716721010SABAMCOR WISCONSIN LLC1 MD20 AIRLOCKM/S6/17/20226/10/20228977SSSSSP XMD20,304L,CE,8VN,FR8,C1FALSEFALSETRUETRUETRUEJune 2022
11004721651010SABECOLAB KAY CHEMICAL CO1 MD20 AIRLOCKM/S6/10/20226/3/202212784316L316L 32RA XSP 32RA XMD20,316,OE,8VN,FR16,CG150,RV,SPCL 32RAFALSEFALSETRUETRUETRUEJune 2022
11004724441010SABRB MANUFACTURING LLC1MD20 AIRLOCK RB MANUFACTURING LLCM/S7/15/20227/8/20228431SSSS XSP CP XMD20,304L,CE,8VN,FR8,C1FALSEFALSEFALSEFALSETRUEJuly 2022
11004680884040SABICL SPECIALTY PRODUCTS INC1 MD20 ROTORM/S7/1/20226/24/20222519SSNANARETURN=NEDOXFALSEFALSETRUEFALSETRUEJune 2022
11004713591010SABHEARTLAND FOOD PRODUCTS1OE8,MD20,FR1/8,C1,80,304/L,CW *M/S4/22/20224/18/20221505304LNANAMD20,304L,OE,8VN,FR8,CG80,C1,CW4/26/2022 0:00FALSETRUETRUEFALSETRUEApril 2022
110046808810.110.1SABICL SPECIALTY PRODUCTS INC1 MD20 AIRLOCK - food grade nedoxM/S7/1/20226/17/2022SSNANAMD20,304L,CE,8VN,FR16,RV,C2 NEDOX XFALSEFALSETRUEFALSETRUEJune 2022
110046808840.140.1SABICL SPECIALTY PRODUCTS INC1 MD20 ROTOR - food grade nedoxM/S7/1/20226/17/2022 0:00304LNANAMD20,MD20,304L,CE,8VN,FR16,RV,C1 NEDOX XFALSEFALSETRUEFALSETRUEJune 2022
11004739441010SABWACKER CHEMICAL CORPORATION1 MD20 AIRLOCKM/S8/12/20228/5/2022 0:0014412316SS316SSSP CP TS4MD20,316,CE,8VN,FR16,RV,C1FALSEFALSEFALSEFALSETRUEAugust 2022
11004757651010SABBIG HEART PET BRANDS1 MD20 AIRLOCKM/S6/10/20226/3/2022 0:000SSSSSP XMD20,SS,OE,8VN,FR8,CG80,C26/7/2022 0:00FALSETRUETRUETRUETRUEJune 2022
11004762971010SABVAN DIEST SUPPLY CO1OE8,MD20,FR1/8,C1,80RP,304/LM/S6/29/20226/24/2022 0:001939304LNANAMD20,304L,OE,8VN,FR8,CG80,RP,C1FALSEFALSETRUEFALSETRUEJune 2022


Given the SUMIFS equation to filter out the accurate count of the particular part, I want to sum all the items data table above. if there is a dot item on the item column, for example "10.1", I want to count only the 10.1 and not the 10 associated with the same customer. So, the customer ICL specialty products should only be counted once instead of twice. because it has a 10.1 and a 10. IF there is no dotline then the dates should be filtered between the [job-pln] column, if there is a dotline column, the result should be filtered between the [ship-act] column. know it's hard to explain. thanks for the help
 
I get the "problem with this formula" error. I am using 365. i added the helper column and get ones and zeroes just as you.

=let(desc,"*MD 20", matg1, {"*SS*", "*304*", "*316*"}, matg2, {"*GI*","*CS*"}, tblprod, 'sab-prod'!A:R, maxitm,'sab-prod'!X:X,mats,matg1, date1,if(mod(index(tblprod,,3),1)<>0,index(tblprod,,10),index(tblprod,,17)), res,filter(filter(tblprob,(ISNUMBER(SEARCH(desc,index(tblprod,,7))))*(MMULT(--(ISNUMBER((SEARCH(mats,INDEX(tblprod,,13)))), SEQUENCE(COUNTA(mats),1,1,0))>0)*(date1>=Airlocks!$L$3)*(date1<=Airlocks!$L$4)*(INDEX(tblprod,,18)=FALSE)*(maxitm=)),{1,0,1,0,1,1,1,0,0,1,0,0,0,0,0,0,1,0}), sum(INDEX(res,,4)))
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
I'm assuming the 1's and 0's response refers to what you see in the helper column?
What column is the helper column? I added it to column Y...did you add it to X? Your formula suggests that you did.
Remove the wildcard "*" from the desc text and the matg1 and matg2 arrays...I don't think this is really a problem, but since the formula uses SEARCH, it looks for those substrings and wildcards should not be needed. I don't see any other issues, but let me know what you get.
 
Last edited:
Upvote 0
Oh...I see the issue. You've changed the range so that it now includes the header row where text is found. So operations like MOD will throw an error. Change the references to something like X2:X1000 and A2:R1000...or something plenty long, but don't include row 1.
 
Upvote 0
Thank you for your help so far but I am still getting a #ref error and can't figure out why.

=LET(desc, "MD20 air", matg1, {"SS","304","316"}, matg2, {"GI","CS"}, tblprod, sab_prod!$A$2:$R$67, maxitm, sab_prod!$Y$2:$Y$67, mats, matg1, date, IF(MOD(INDEX(tblprod,,3),1)<>0,INDEX(tblprod,,10),INDEX(tblprod,,17)), res, FILTER(FILTER(tblprod, (ISNUMBER(SEARCH(desc,INDEX(tblprod,,7))))* (MMULT(--(ISNUMBER(SEARCH(mats,INDEX(tblprod,,13)))),SEQUENCE(COUNTA(mats),1,1,0))>0)* (date>=Airlocks!$L$3)* (date<=Airlocks!$L$4)* (INDEX(tblprod,,18)=FALSE)* (maxitm=1)), {1,0,1,0,1,1,1,0,0,1,0,0,0,0,0,0,1,0}), SUM(INDEX(res,,4)) )
 
Upvote 0
That's puzzling...let's confirm some things because the #REF error suggests there is an invalid reference somewhere, which could happen if something is deleted or shifted on the worksheet.

For the sab_prod worksheet:
  1. You have a helper column Y (you showed X in your previous post) on the sab_prod worksheet and the results in those cells make sense?... you see 1's in nearly all of the cells and 0's for those rows that should be excluded because of the dotline criteria?
  2. The actual data in the sab_prod tables resides in rows 2:67?
  3. The main body of data that is to be examined on sab_prod sheet is in sab_prod!$A$2:$R$67?
  4. The column that holds the dot/no-dot values used for decision making is column C, the 3rd column?
  5. The two date columns to be used are columns J and Q (columns 10 and 17), column J for dotlines, and column Q for no dots?
  6. The Description column where we would find the text "MD20 air" is column G, the 7th column.
  7. The mch-mat (material) column is column M, the 13th column?
  8. The "cancel" column where we find mostly (all?) FALSE's is column R, the 18th column?
  9. The "qty" column whose values are to be summed, subject to certain conditions, is column F, the 6th column on the sab_prod sheet?
For the Airlock worksheet:
  1. The "date" range of interest is described on the Airlock sheet in only two cells: L3 and L4 for the early and late dates, respectively?
When I paste your formula into my workbook, it works fine...no adjustments needed...so I suspect there is some minor change in the tables.
 
Upvote 0
I'm curious if you managed to get this working?
 
Upvote 0
Another option is to create a copy of the workbook and replace any sensitive information (if that information is critical for the formulas) with other non-sensitive information...and then upload the file to a common file-sharing site (e.g., Dropbox, Box, Google Drive, etc.) and share the link here.
 
Upvote 0
Thanks. If you go to the Airlocks worksheet and check the Date Range in L3:L4, you'll see that they are entered as text. For example, =TYPE(L3) for the start date returns a 2 indicating it is text (a numeric value would return a 1). The solution I posted assumes the date will be numeric. The easiest fix is to coerce those text-formatted dates into actual numeric date values by multiplying them by 1...so on the Airlocks worksheet, edit L3 and L4 to be:
Excel Formula:
=1*Datepicker!H2
=1*Datepicker!I2
Also modify these terms in the LET formula to cover the entire data range (full range shown here):
Excel Formula:
tblprod, sab_prod!$A$2:$R$1789, maxitm, sab_prod!$Y$2:$Y$1789
Then let me know if you see expected results.
 
Upvote 0

Forum statistics

Threads
1,215,098
Messages
6,123,082
Members
449,094
Latest member
mystic19

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