The following table represents data on a sheet named "COMPLETE". I've included the column headers and the row numbers to (hopefully) make it easier to explain. Also note that the data headers are in row 1.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[TD]K[/TD]
[TD]L[/TD]
[TD]M[/TD]
[TD]N[/TD]
[TD]O[/TD]
[TD]P[/TD]
[TD]Q[/TD]
[TD]R[/TD]
[TD]S[/TD]
[TD]T[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]APPROVE DATE[/TD]
[TD]PO #[/TD]
[TD]DATE[/TD]
[TD]DATE[/TD]
[TD]STATUS[/TD]
[TD]VALIDATION[/TD]
[TD]DIV[/TD]
[TD]VENDOR[/TD]
[TD]SUPP[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]ON EDI[/TD]
[TD][/TD]
[TD]SPEC ORD[/TD]
[TD][/TD]
[TD]BUYER[/TD]
[TD]IMPORT FLAG[/TD]
[TD]SPEC CHAR[/TD]
[TD]BULK[/TD]
[TD]DATE[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]8/10/2017[/TD]
[TD]10100093891[/TD]
[TD]8/1/2017[/TD]
[TD]7/7/2017[/TD]
[TD][/TD]
[TD]WRONG SUPPLIER SITE[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]YES[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]YES[/TD]
[TD]NO[/TD]
[TD]NO[/TD]
[TD]6/19/2017[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]8/4/2017[/TD]
[TD]10100093877[/TD]
[TD]8/1/2017[/TD]
[TD]8/15/2017[/TD]
[TD][/TD]
[TD]IMPORT ORDER[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]NO[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]YES[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]8/3/2017[/TD]
[TD]10100093999[/TD]
[TD]8/1/2017[/TD]
[TD]7/7/2017[/TD]
[TD][/TD]
[TD]GLC NOT LOADED[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]YES[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]NO[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]8/4/2017[/TD]
[TD]10100093665[/TD]
[TD]8/1/2017[/TD]
[TD]8/15/2017[/TD]
[TD][/TD]
[TD]DOMESTIC[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]NO[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]NO[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]9/4/2017[/TD]
[TD]10100093777[/TD]
[TD]10/05/2017[/TD]
[TD]10/8/2017[/TD]
[TD][/TD]
[TD]GLC NOT LOADED[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]YES[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]10/9/2017[/TD]
[TD]10100093555[/TD]
[TD]10/08/2017[/TD]
[TD]10/5/2017[/TD]
[TD][/TD]
[TD]DOMESTIC[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]NO[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]NO
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
***There may be blank rows on this sheet ***
Next is the cover sheet, named "MONTH END TOTALS"
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[TD]K[/TD]
[TD]L[/TD]
[TD]M[/TD]
[TD]N[/TD]
[TD]O[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD]2017[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]=VALUE(MATCH(99^99,COMPLETE'!A:A,1))[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD]AUG[/TD]
[TD]SEP[/TD]
[TD]OCT[/TD]
[TD]NOV[/TD]
[TD]DEC[/TD]
[TD]JAN[/TD]
[TD]FEB[/TD]
[TD]MAR[/TD]
[TD]APR[/TD]
[TD]MAY[/TD]
[TD]JUN[/TD]
[TD]JUL[/TD]
[TD]TOTAL[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[TD]=SUM(IF(TEXT(INDIRECT("COMPLETE!$A$2:$A$"&$O$2),"*MM/YYYY")=( (MONTH(C$3&1))&"/"&$C$2),1,0))[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD]=SUMPRODUCT(--(IF(TEXT(INDIRECT("COMPLETE!$A$2:$A$"&$O$2),"*MM/YYYY")=((MONTH(C$3&1))&"/"&$C$2),1,0))*(--(IF((TEXT(INDIRECT("COMPLETE!$F$2:$F$"&$O$2),"@")="ALLOCATION"),1,0))))[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD]=SUMPRODUCT(--(IF(TEXT(INDIRECT("COMPLETE!$A$2:$A$"&$O$2),"*MM/YYYY")=((MONTH(C$3&1))&"/"&$C$2),1,0))*(--((((IF(NOT((TEXT(INDIRECT("COMPLETE!$Q$2:$Q$"&$O$2),"@")="YES")+(TEXT(INDIRECT("COMPLETE!$Q$2:$Q$"&$O$2),"@")="0")),1,0)+(((IF(TEXT(INDIRECT("COMPLETE!$L$2:$L$"&$O$2),"@")="NO",1,0))))*(--(IF((TEXT(INDIRECT("COMPLETE!$Q$2:$Q$"&$O$2),"@")="YES")+(TEXT(INDIRECT("COMPLETE!$Q$2:$Q$"&$O$2),"@")="0"),1,0)))))))))[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD]=SUMPRODUCT(--(IF(TEXT(INDIRECT("COMPLETE!$A$2:$A$"&$O$2),"*MM/YYYY")=((MONTH(C$3&1))&"/"&$C$2),1,0))*(--(IF((TEXT(INDIRECT("COMPLETE!$F$2:$F$"&$O$2),"@")="GLC Not Loaded"),1,0))))[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD][/TD]
[TD][/TD]
[TD]=SUMPRODUCT(--(IF(TEXT(INDIRECT("COMPLETE!$A$2:$A$"&$O$2),"*MM/YYYY")=((MONTH(C$3&1))&"/"&$C$2),1,0))*(--(IF((TEXT(INDIRECT("COMPLETE!$F$2:$F$"&$O$2),"@")="WRONG SUPPLIER")+(TEXT(INDIRECT("COMPLETE!$F$2:$F$"&$O$2),"@")="DOMESTIC"),1,0))))[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD][/TD]
[TD][/TD]
[TD]=SUMPRODUCT(--(IF(TEXT(INDIRECT("'LIST OF VENDORS WHO ARE ON EDI'!$J$2:$J$"&$O$2),"*MM/YYYY")=((MONTH(C$3&1))&"/"&$C$2),1,0))*(--(IF((TEXT(INDIRECT("'LIST OF VENDORS WHO ARE ON EDI'!$G$2:$G$"&$O$2),"@")="NEW"),1,0))))[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
On the TOTALS sheet:
- O2 represents the last row with data in it. The number of rows will vary depending on whether rows have been added or removed since last time the workbook was opened.
- The formulas in the table refer back to O2 very often, to denote the range of cells being looked at, so the formulas don't have to look ALL the way to the last possible row.
- Obviously, C2 is the year being evaluated. and C3 is the month being evaluated
* Cell C4 looks at the month and year - in the example, AUG 2017, and finds out how many rows with that month/year are in the range A2 through A(O2 on TOTALS) of the COMPLETE tab.
* Cell C5 finds out how many cells on COMPLETE with that month/year, in the range F2 through F(O2 on TOTALS) have the word "ALLOCATION".
* Cell C6 finds out how many of the rows on COMPLETE with that month/year meet the following criteria:
- Not "YES" in column Q
- Not blank in column Q
- "NO" in column L, only if they haven't been counted in Q by the 2 criteria above.
* Cell C7 finds out how many of the rows on COMPLETE with that month/year, in the range F2 through F(O2 on TOTALS) have the text "GLC NOT LOADED".
* Cell C8 finds out how many of the rows on COMPLETE with that month/year, in the range F2 through F(O2 on TOTALS) have either "WRONG SUPPLIER" or "DOMESTIC".
* Cell C10 looks at another tab called "LIST OF VENDORS WHO ARE ON EDI", and finds out how many of the rows on that sheet in the range J2 through J(O2 on TOTALS) with the matching month/year also have "NEW" in G of that sheet.
AND, D4 looks at the month in D3 and the year in C2 and does all the same calculations using THAT as the basis for the evaluations - in the example, SEP 2017. Same with E4, F4, G4.....
This co-worker also has multiple years on the MONTH END TOTALS sheet, so then ALL of these SUMPRODUCT formulas (most of which are also array formulas) are on that sheet WAYYY too many times. At this point, I'm sure you can imagine how slowly this thing goes!
If this can't be speeded up noticeably, he'd be okay with just having a macro to run several times a day. I had thought to use formulas to make it be up to date not matter how recently new data got entered.
So, what do you all think? Is there any hope?
Thanks,
Jenny