I'm exporting data for a manufacturing environment and importing the CSV into Excel. This data refreshes every 5 minutes.
On the first worksheet, I'm able to calculate efficiency % properly (N:N) with a single SUMIFS and a single COUNTIFS. However, when I try to add two SUMIFS and divide by two added COUNTIFS the calculation reports an incorrect result. I should add that there are times when either "HMP20 1" or "GHMP20 1" are not present.
This formula returns the expected result 100.83:
=(SUMIFS('EP2P Mold Summary All Shifts'!N:N,
'EP2P Mold Summary All Shifts'!B:B, "1",
'EP2P Mold Summary All Shifts'!C:C, "GHMP20 1")/
(COUNTIFS('EP2P Mold Summary All Shifts'!N:N, ">0",
'EP2P Mold Summary All Shifts'!B:B, "1",
'EP2P Mold Summary All Shifts'!C:C, "GHMP20 1")))
This calculation returns an incorrect result: 388.61:
=(SUMIFS('EP2P Mold Summary All Shifts'!N:N,
'EP2P Mold Summary All Shifts'!B:B, "1",
'EP2P Mold Summary All Shifts'!C:C,"HMP20 1")+
SUMIFS('EP2P Mold Summary All Shifts'!N:N,
'EP2P Mold Summary All Shifts'!B:B, "1",
'EP2P Mold Summary All Shifts'!C:C, "GHMP20 1")/
(COUNTIFS('EP2P Mold Summary All Shifts'!N:N, ">0",
'EP2P Mold Summary All Shifts'!B:B, "1",
'EP2P Mold Summary All Shifts'!C:C, "HMP20 1")+
COUNTIFS('EP2P Mold Summary All Shifts'!N:N, ">0",
'EP2P Mold Summary All Shifts'!B:B, "1",
'EP2P Mold Summary All Shifts'!C:C, "GHMP20 1")))
Sample Data
Worksheet: "EP2P Mold Summary All Shifts"
| B | C | D - M | N | ||
|---|---|---|---|---|---|
| 1 | Shift | Machine | EFF % | ||
| 2 | 1 | GHMP20 1 | 101 | ||
| 3 | 1 | GHMP20 1 | 98 | ||
| 4 | 1 | HMP20 1 | 112 | ||
| 5 | 3 | HMP20 1 | 87 | ||
| 6 | 3 | SINTO 7 | 92 | ||
| 7 | 3 | GSINTO 7 |
Data worksheet: "EP2P Mold Summary All Shifts"

"Results Worksheet: "Mold Summary All Shifts"
