Hi,
Having problem trying to figure out why sumproduct is returning different, and incorrect results, compared to SUMIFS.
Result sheet
Order Number Cost Centre Desc SUMIFS SUMPRODUCT
1026939 Dispensing 150 150
1026939 Dispensing 150 150
1026939 Dispensing 150 0
1026939 Dispensing 150 0
1026939 Dispensing 150 0
1026939 Dispensing 150 0
1026939 Steroid Dispensing 0 150
1026939 Steroid Dispensing 0 150
1026939 Steroid Dispensing 0 0
1026939 Steroid Dispensing 0 0
1026939 Steroid Dispensing 0 0
1026939 Steroid Dispensing 0 0
Formulae
SUMIFS(zcapacity!$G$2:$G$1784,zcapacity!$A$2:$A$1784,microstrategy!A4,zcapacity!$E$2:$E$1784,microstrategy!E4)
SUMPRODUCT((zcapacity!$A$2:$A$1784=microstrategy!A4)*(microstrategy!$E$2:$E$1784=TRIM(zcapacity!E4))*(zcapacity!$G$2:$G$1784*1))
150 is correct as two rows for the Order have dispensing matches ( 60+90).
The first problem is that SUMPRODUCT reporting zeros twice when sumifs correctly reports six times for the six rows of data have matches on columns E.
The second problem is that SUMPRODUCT makes incorrect matches on "Steroid Dispensing" which doesnot exist in zcapacity worksheet and appears to match on the "Dispensing" records. Almost like it is doing a "text contained" match.
I reformatted the column E data in both sheets to Text and ensured there where no leading/trailing spaces, but the error is not fixed. I have done an cell equals check between the Order number (col A) and Short Desc (col E) cells in both sheets and all show TRUE.
Extract of the zcapacity lookup data (sensitive columns hidden):
Col A Col B Col E
Order Short desc. Actual
1026939 COMPRESSION CONTAINMENT SUITE 2 (D4) 630
1026939 COMPRESSION CONTAINMENT SUITE 2 (D4)
1026939 CONTAINMENT SUITE 2 1,320
1026939 CONTAINMENT SUITE 2
1026939 DISPENSING 0
1026939 DISPENSING 0
1026939 DISPENSING 0
1026939 DISPENSING 60
1026939 DISPENSING 90
1026939 DISPENSING
1026939 DISPENSING CONTAINMENT SUITE
1026939 DISPENSING CONTAINMENT SUITE 60
1026939 DISPENSING CONTAINMENT SUITE
One oddity in the zcapacity data is that Col E results can be null or zero.
Very puzzling/disturbing to me, especially as I tend to prefer using sumproduct and it is certainly not trustworthy in this instance while sumifs is accurate.
Any ideas on what's going wrong?
Cheers,
Mark
Having problem trying to figure out why sumproduct is returning different, and incorrect results, compared to SUMIFS.
Result sheet
Order Number Cost Centre Desc SUMIFS SUMPRODUCT
1026939 Dispensing 150 150
1026939 Dispensing 150 150
1026939 Dispensing 150 0
1026939 Dispensing 150 0
1026939 Dispensing 150 0
1026939 Dispensing 150 0
1026939 Steroid Dispensing 0 150
1026939 Steroid Dispensing 0 150
1026939 Steroid Dispensing 0 0
1026939 Steroid Dispensing 0 0
1026939 Steroid Dispensing 0 0
1026939 Steroid Dispensing 0 0
Formulae
SUMIFS(zcapacity!$G$2:$G$1784,zcapacity!$A$2:$A$1784,microstrategy!A4,zcapacity!$E$2:$E$1784,microstrategy!E4)
SUMPRODUCT((zcapacity!$A$2:$A$1784=microstrategy!A4)*(microstrategy!$E$2:$E$1784=TRIM(zcapacity!E4))*(zcapacity!$G$2:$G$1784*1))
150 is correct as two rows for the Order have dispensing matches ( 60+90).
The first problem is that SUMPRODUCT reporting zeros twice when sumifs correctly reports six times for the six rows of data have matches on columns E.
The second problem is that SUMPRODUCT makes incorrect matches on "Steroid Dispensing" which doesnot exist in zcapacity worksheet and appears to match on the "Dispensing" records. Almost like it is doing a "text contained" match.
I reformatted the column E data in both sheets to Text and ensured there where no leading/trailing spaces, but the error is not fixed. I have done an cell equals check between the Order number (col A) and Short Desc (col E) cells in both sheets and all show TRUE.
Extract of the zcapacity lookup data (sensitive columns hidden):
Col A Col B Col E
Order Short desc. Actual
1026939 COMPRESSION CONTAINMENT SUITE 2 (D4) 630
1026939 COMPRESSION CONTAINMENT SUITE 2 (D4)
1026939 CONTAINMENT SUITE 2 1,320
1026939 CONTAINMENT SUITE 2
1026939 DISPENSING 0
1026939 DISPENSING 0
1026939 DISPENSING 0
1026939 DISPENSING 60
1026939 DISPENSING 90
1026939 DISPENSING
1026939 DISPENSING CONTAINMENT SUITE
1026939 DISPENSING CONTAINMENT SUITE 60
1026939 DISPENSING CONTAINMENT SUITE
One oddity in the zcapacity data is that Col E results can be null or zero.
Very puzzling/disturbing to me, especially as I tend to prefer using sumproduct and it is certainly not trustworthy in this instance while sumifs is accurate.
Any ideas on what's going wrong?
Cheers,
Mark