To sum it up, I basically have a sumif statement that works fine, however I need to add an additional paremeter that not only must one column match for the values to be summed, two different columns have to be correct.
Hi, the code I currently have is as follows:
Excel 2002
Excel 2002
Here is a sample of the query I'm using:
Excel 2002
What my code currently does, is it looks at my query and sums all of the tickets based upon which door (column F) the item is going to. What I need it to do, is to only sum tickets of the same door WITH column C = to 10 (or whatever is entered in by a user in lets say, column A1)
Essentially I thought something along the lines of an If statement would work, however its almost like I need a sumif nested in a sumif? I'm not sure if thats possible though...
Hi, the code I currently have is as follows:
Excel Workbook | ||||||||
---|---|---|---|---|---|---|---|---|
L | M | N | O | P | Q | |||
1 | Query Info Tickets | |||||||
2 | total | 57 | 58 | 59 | 60 | |||
3 | A09 | 732 | 30 | 15 | 0 | 22 | ||
4 | AA2 | 0 | 0 | 0 | 0 | 0 | ||
5 | AB1 | 8 | 0 | 0 | 0 | 0 | ||
6 | AC2 | 0 | 0 | 0 | 0 | 0 | ||
Code |
Cell Formulas | ||
---|---|---|
Range | Formula | |
M3 | =SUMIF('Query Info'!D:D,L3,'Query Info'!I:I) | |
M4 | =SUMIF('Query Info'!D:D,L4,'Query Info'!I:I) | |
M5 | =SUMIF('Query Info'!D:D,L5,'Query Info'!I:I) | |
M6 | =SUMIF('Query Info'!D:D,L6,'Query Info'!I:I) | |
N3 | =SUMPRODUCT(--('Query Info'!$D$1:$D$65000=Code!$L3),--('Query Info'!$F$1:$F$65000=Code!N$2),'Query Info'!$I$1:$I$65000) | |
N4 | =SUMPRODUCT(--('Query Info'!$D$1:$D$65000=Code!$L4),--('Query Info'!$F$1:$F$65000=Code!N$2),'Query Info'!$I$1:$I$65000) | |
N5 | =SUMPRODUCT(--('Query Info'!$D$1:$D$65000=Code!$L5),--('Query Info'!$F$1:$F$65000=Code!N$2),'Query Info'!$I$1:$I$65000) | |
N6 | =SUMPRODUCT(--('Query Info'!$D$1:$D$65000=Code!$L6),--('Query Info'!$F$1:$F$65000=Code!N$2),'Query Info'!$I$1:$I$65000) | |
O3 | =SUMPRODUCT(--('Query Info'!$D$1:$D$65000=Code!$L3),--('Query Info'!$F$1:$F$65000=Code!O$2),'Query Info'!$I$1:$I$65000) | |
O4 | =SUMPRODUCT(--('Query Info'!$D$1:$D$65000=Code!$L4),--('Query Info'!$F$1:$F$65000=Code!O$2),'Query Info'!$I$1:$I$65000) | |
O5 | =SUMPRODUCT(--('Query Info'!$D$1:$D$65000=Code!$L5),--('Query Info'!$F$1:$F$65000=Code!O$2),'Query Info'!$I$1:$I$65000) | |
O6 | =SUMPRODUCT(--('Query Info'!$D$1:$D$65000=Code!$L6),--('Query Info'!$F$1:$F$65000=Code!O$2),'Query Info'!$I$1:$I$65000) | |
P3 | =SUMPRODUCT(--('Query Info'!$D$1:$D$65000=Code!$L3),--('Query Info'!$F$1:$F$65000=Code!P$2),'Query Info'!$I$1:$I$65000) | |
P4 | =SUMPRODUCT(--('Query Info'!$D$1:$D$65000=Code!$L4),--('Query Info'!$F$1:$F$65000=Code!P$2),'Query Info'!$I$1:$I$65000) | |
P5 | =SUMPRODUCT(--('Query Info'!$D$1:$D$65000=Code!$L5),--('Query Info'!$F$1:$F$65000=Code!P$2),'Query Info'!$I$1:$I$65000) | |
P6 | =SUMPRODUCT(--('Query Info'!$D$1:$D$65000=Code!$L6),--('Query Info'!$F$1:$F$65000=Code!P$2),'Query Info'!$I$1:$I$65000) | |
Q3 | =SUMPRODUCT(--('Query Info'!$D$1:$D$65000=Code!$L3),--('Query Info'!$F$1:$F$65000=Code!Q$2),'Query Info'!$I$1:$I$65000) | |
Q4 | =SUMPRODUCT(--('Query Info'!$D$1:$D$65000=Code!$L4),--('Query Info'!$F$1:$F$65000=Code!Q$2),'Query Info'!$I$1:$I$65000) | |
Q5 | =SUMPRODUCT(--('Query Info'!$D$1:$D$65000=Code!$L5),--('Query Info'!$F$1:$F$65000=Code!Q$2),'Query Info'!$I$1:$I$65000) | |
Q6 | =SUMPRODUCT(--('Query Info'!$D$1:$D$65000=Code!$L6),--('Query Info'!$F$1:$F$65000=Code!Q$2),'Query Info'!$I$1:$I$65000) |
Excel Workbook | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
AA | AB | AC | AD | AE | AF | AG | AH | |||
5 | 88 | 87 | 86 | 85 | 84 | 83 | ||||
6 | 0 | 40 | 0 | 62 | 57 | 52 | ||||
Purdue Actual Tool |
Cell Formulas | ||
---|---|---|
Range | Formula | |
AA6 | =SUMIF('Query Info'!$F:$F,'Purdue Actual Tool'!AA5,'Query Info'!$I:$I) | |
AB6 | =CellAndComment(SUMIF('Query Info'!$F:$F,'Purdue Actual Tool'!AB5,'Query Info'!$I:$I), "Mod A: "&Code!AN26&CHAR(10)&"Mod B: "&Code!AN27&CHAR(10)&"Mod C: "&Code!AN28) | |
AC6 | =SUMIF('Query Info'!$F:$F,'Purdue Actual Tool'!AC5,'Query Info'!$I:$I) | |
AD6 | =SUMIF('Query Info'!$F:$F,'Purdue Actual Tool'!AD5,'Query Info'!$I:$I) | |
AE6 | =CellAndComment(SUMIF('Query Info'!$F:$F,'Purdue Actual Tool'!AE5,'Query Info'!$I:$I), "Mod A: "&Code!AM26&CHAR(10)&"Mod B: "&Code!AM27&CHAR(10)&"Mod C: "&Code!AM28) | |
AF6 | =SUMIF('Query Info'!$F:$F,'Purdue Actual Tool'!AF5,'Query Info'!$I:$I) | |
AG6 | =CellAndComment(SUMIF('Query Info'!$F:$F,'Purdue Actual Tool'!AG5,'Query Info'!$I:$I), "Mod A: "&Code!AL26&CHAR(10)&"Mod B: "&Code!AL27&CHAR(10)&"Mod C: "&Code!AL28) | |
AH6 | =CellAndComment(SUMIF('Query Info'!$F:$F,'Purdue Actual Tool'!AH5,'Query Info'!$I:$I), "Mod A: "&Code!AK26&CHAR(10)&"Mod B: "&Code!AK27&CHAR(10)&"Mod C: "&Code!AK28) |
Here is a sample of the query I'm using:
Excel Workbook | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | |||
1 | 1 | ||||||||||
2 | |||||||||||
3 | LOAD | ||||||||||
4 | LOAD | TRIP | ZN | BIN | DOOR | DIV | ITM | ||||
5 | DT | NO | NO | NO | NO | NO | NO | TICKETS | |||
6 | ---------- | ---- | --- | ------------ | ---- | ---- | ------- | ----------- | |||
7 | 8/5/2010 | 10 | B71 | 7.94E+08 | 65 | 671 | 16431 | 1 | |||
8 | 8/5/2010 | 10 | A09 | 7.81E+08 | 66 | 642 | 70121 | 1 | |||
9 | 8/5/2010 | 10 | B71 | 7.91E+08 | 72 | 609 | 21805 | 45 | |||
10 | 8/5/2010 | 10 | AJP | 7.91E+08 | 74 | 606 | 21874 | 1 | |||
11 | 8/5/2010 | 10 | A09 | 7.65E+08 | 74 | 642 | 70151 | 2 | |||
12 | 8/5/2010 | 10 | A09 | 7.65E+08 | 74 | 646 | 94683 | 1 | |||
13 | 8/5/2010 | 10 | A09 | 7.65E+08 | 74 | 642 | 70181 | 2 | |||
14 | 8/5/2010 | 10 | A09 | 7.65E+08 | 74 | 609 | 59355 | 1 | |||
15 | 8/5/2010 | 16 | A09 | 7.65E+08 | 74 | 642 | 71123 | 1 | |||
16 | 8/5/2010 | 16 | A09 | 7.65E+08 | 74 | 609 | 1255 | 2 | |||
17 | 8/5/2010 | 16 | A09 | 7.65E+08 | 74 | 642 | 70101 | 1 | |||
18 | 8/5/2010 | 16 | A09 | 7.81E+08 | 74 | 609 | 13990 | 1 | |||
19 | 8/5/2010 | 16 | A09 | 7.81E+08 | 74 | 609 | 20012 | 1 | |||
20 | 8/5/2010 | 16 | A09 | 7.81E+08 | 74 | 657 | 50107 | 1 | |||
21 | 8/5/2010 | 16 | A09 | 7.81E+08 | 74 | 609 | 13991 | 1 | |||
Query Info |
Excel 2002
What my code currently does, is it looks at my query and sums all of the tickets based upon which door (column F) the item is going to. What I need it to do, is to only sum tickets of the same door WITH column C = to 10 (or whatever is entered in by a user in lets say, column A1)
Essentially I thought something along the lines of an If statement would work, however its almost like I need a sumif nested in a sumif? I'm not sure if thats possible though...