@AYSHANA
Please review the
Forum Rules, particularly #14 in relation to your thread title & posts 5 & 6.
There are a few things that are going wrong or could be going wrong
- Your SUMPRODUCT formula =SUMPRODUCT(--($R$1:$R$2993=$X2),--(MONTH($Q$2:$Q$2993)=Y$1&$P$1),--($R$1:$R$2993)) will fail because it does not have equal sized ranges. The R ranges got from 1:2993 but the Q range goes from 2:2993
- Your SUMPRODUCT formula =SUMPRODUCT(--($R$1:$R$2993=$X2),--(MONTH($Q$2:$Q$2993)=Y$1&$P$1),--($R$1:$R$2993)) will fail because of the red part. Column R is not numerical so trying to convert it to a number with -- will create an error.
- Your SUMPRODUCT formula =SUMPRODUCT(--($R$1:$R$2993=$X2),--(MONTH($Q$2:$Q$2993)=Y$1&$P$1),--($R$1:$R$2993)) will fail because of the coloured part. The red part will return a number in relation to the column Q dates, whereas the blue part will return text. Even if the red part returned the short text month (eg "Jan") the whole coloured part would still never count because the red part returns month only and the blue part returns month and year.
- Your SUMPRODUCT formula could fail if the VLOOKUP formulas in column Q or R ever fails to find the column K date in 'not received'. In that case the VLOOKUP would return a #N/A error which would flow to your SUMPRODUCT formulas causing them to also return #N/A
My suggestion then is to
- Change the Q1 formula to =IFNA(VLOOKUP($K1,'not received'!$A2:E30000,5,0),"") & copy down
- Change the R1 formula to =IFNA(VLOOKUP($K1,'not received'!$A2:F30000,6,0),"") & copy down
- Change the Y2 formula to =SUMPRODUCT(--($R$1:$R$2993=$X2),--(TEXT($Q$1:$Q$2993,"mmmyyyy")=Y$1&$P$1)) and copy across and down.