SUMPRODUCT Formula Fix

Excel_Assis

Board Regular
Joined
Feb 19, 2011
Messages
132
Office Version
  1. 2016
Platform
  1. Windows
Can anyone tell me how to fix this SUMPRODUCT Formula. I am missing brackets or something.

This formula would be in cells in column E of Sheet2.

So basically I need a result in the cell from either the first part of the formula or the second part which either part is true.

=SUMPRODUCT(--(Sheet1!C$2:C$20=Sheet2!C9),--(Sheet1!G$2:G$20=Sheet2!D9),Sheet1!H$2:H$20),(--(Sheet1!C$2:C$20=Sheet2!C9),--(Sheet1!I$2:I$20=Sheet2!D9),Sheet1!J$2:J$20)



Excel Workbook
ABCDEFGHIJ
1DateItemAcc NoUS$ or RRecJob No. AJob A US$Job No. BJob B US$
230/04/2011Dog9-0715R45001.125CASO331.125
35/05/2011Cat9-070533CASO321.5CASO331.5
45/05/2011Rat9-080555CASO322.5CASO332.5
56/05/2011Cat9-07052.42.4CASO321.2CASO331.2
66/05/2011Dog9-0715R20000.5CASO320.25CASO330.25
76/05/2011Pig9-01044CASO324
86/05/2011Dog9-0715R40001CASO320.5CASO330.5
96/05/2011Cat9-0705R4300010.75CASO325.375CASO335.375
106/05/2011Cat9-0705R300007.5CASO323.75CASO333.75
117/05/2011Rat9-08051010CASO325CASO335
Sheet1




Result I am trying to achieve.

Excel Workbook
ABCDEF
1Date EnteredAccount Name/DescriptionGL/AC No.Job No.Amount
2DebitCredit
3123456
4Cat9-0705CASO32$11.83
5Cat9-0705CASO33$11.83
6Dog9-0715CASO32$0.75
7Dog9-0715CASO33$1.88
8Rat9-0805CASO32$7.50
9Rat9-0805CASO33$7.50
10Pig9-0710CASO32$4.00
Sheet2
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Can anyone tell me how to fix this SUMPRODUCT Formula. I am missing brackets or something.

This formula would be in cells in column E of Sheet2.

So basically I need a result in the cell from either the first part of the formula or the second part which either part is true.

=SUMPRODUCT(--(Sheet1!C$2:C$20=Sheet2!C9),--(Sheet1!G$2:G$20=Sheet2!D9),Sheet1!H$2:H$20),(--(Sheet1!C$2:C$20=Sheet2!C9),--(Sheet1!I$2:I$20=Sheet2!D9),Sheet1!J$2:J$20)



Sheet1

<TABLE style="PADDING-RIGHT: 2pt; PADDING-LEFT: 2pt; FONT-SIZE: 11pt; FONT-FAMILY: Calibri,Arial; BACKGROUND-COLOR: #ffffff" cellSpacing=0 cellPadding=0 border=1><COLGROUP><COL style="FONT-WEIGHT: bold; WIDTH: 30px"><COL style="WIDTH: 75px"><COL style="WIDTH: 118px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"></COLGROUP><TBODY><TR style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"><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></TR><TR style="HEIGHT: 19px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">1</TD><TD style="FONT-WEIGHT: bold; COLOR: #ffffff; BACKGROUND-COLOR: #33cccc">Date</TD><TD style="FONT-WEIGHT: bold; COLOR: #ffffff; BACKGROUND-COLOR: #33cccc">Item</TD><TD style="FONT-WEIGHT: bold; COLOR: #ffffff; BACKGROUND-COLOR: #33cccc">Acc No</TD><TD style="FONT-WEIGHT: bold; COLOR: #ffffff; BACKGROUND-COLOR: #33cccc">US$ or R</TD><TD style="FONT-WEIGHT: bold; COLOR: #ffffff; BACKGROUND-COLOR: #33cccc"> </TD><TD style="FONT-WEIGHT: bold; COLOR: #ffffff; BACKGROUND-COLOR: #33cccc">Rec</TD><TD style="FONT-WEIGHT: bold; COLOR: #ffffff; BACKGROUND-COLOR: #33cccc">Job No. A</TD><TD style="FONT-WEIGHT: bold; COLOR: #ffffff; BACKGROUND-COLOR: #33cccc">Job A US$</TD><TD style="FONT-WEIGHT: bold; COLOR: #ffffff; BACKGROUND-COLOR: #33cccc">Job No. B</TD><TD style="FONT-WEIGHT: bold; COLOR: #ffffff; BACKGROUND-COLOR: #33cccc">Job B US$</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">2</TD><TD style="TEXT-ALIGN: right">30/04/2011</TD><TD>Dog</TD><TD style="TEXT-ALIGN: right">9-0715</TD><TD style="BACKGROUND-COLOR: #ccccff">R4500</TD><TD style="TEXT-ALIGN: right">1.125</TD><TD> </TD><TD style="BACKGROUND-COLOR: #c0c0c0"> </TD><TD style="BACKGROUND-COLOR: #c0c0c0"> </TD><TD style="BACKGROUND-COLOR: #ccffcc">CASO33</TD><TD style="BACKGROUND-COLOR: #ccffcc; TEXT-ALIGN: right">1.125</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">3</TD><TD style="TEXT-ALIGN: right">5/05/2011</TD><TD>Cat</TD><TD style="TEXT-ALIGN: right">9-0705</TD><TD style="BACKGROUND-COLOR: #ccccff; TEXT-ALIGN: right">3</TD><TD style="TEXT-ALIGN: right">3</TD><TD> </TD><TD style="BACKGROUND-COLOR: #c0c0c0">CASO32</TD><TD style="BACKGROUND-COLOR: #c0c0c0; TEXT-ALIGN: right">1.5</TD><TD style="BACKGROUND-COLOR: #ccffcc">CASO33</TD><TD style="BACKGROUND-COLOR: #ccffcc; TEXT-ALIGN: right">1.5</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">4</TD><TD style="TEXT-ALIGN: right">5/05/2011</TD><TD>Rat</TD><TD style="TEXT-ALIGN: right">9-0805</TD><TD style="BACKGROUND-COLOR: #ccccff; TEXT-ALIGN: right">5</TD><TD style="TEXT-ALIGN: right">5</TD><TD> </TD><TD style="BACKGROUND-COLOR: #c0c0c0">CASO32</TD><TD style="BACKGROUND-COLOR: #c0c0c0; TEXT-ALIGN: right">2.5</TD><TD style="BACKGROUND-COLOR: #ccffcc">CASO33</TD><TD style="BACKGROUND-COLOR: #ccffcc; TEXT-ALIGN: right">2.5</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">5</TD><TD style="TEXT-ALIGN: right">6/05/2011</TD><TD>Cat</TD><TD style="TEXT-ALIGN: right">9-0705</TD><TD style="BACKGROUND-COLOR: #ccccff; TEXT-ALIGN: right">2.4</TD><TD style="TEXT-ALIGN: right">2.4</TD><TD> </TD><TD style="BACKGROUND-COLOR: #c0c0c0">CASO32</TD><TD style="BACKGROUND-COLOR: #c0c0c0; TEXT-ALIGN: right">1.2</TD><TD style="BACKGROUND-COLOR: #ccffcc">CASO33</TD><TD style="BACKGROUND-COLOR: #ccffcc; TEXT-ALIGN: right">1.2</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">6</TD><TD style="TEXT-ALIGN: right">6/05/2011</TD><TD>Dog</TD><TD style="TEXT-ALIGN: right">9-0715</TD><TD style="BACKGROUND-COLOR: #ccccff">R2000</TD><TD style="TEXT-ALIGN: right">0.5</TD><TD> </TD><TD style="BACKGROUND-COLOR: #c0c0c0">CASO32</TD><TD style="BACKGROUND-COLOR: #c0c0c0; TEXT-ALIGN: right">0.25</TD><TD style="BACKGROUND-COLOR: #ccffcc">CASO33</TD><TD style="BACKGROUND-COLOR: #ccffcc; TEXT-ALIGN: right">0.25</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">7</TD><TD style="TEXT-ALIGN: right">6/05/2011</TD><TD>Pig</TD><TD style="TEXT-ALIGN: right">9-010</TD><TD style="BACKGROUND-COLOR: #ccccff; TEXT-ALIGN: right">4</TD><TD style="TEXT-ALIGN: right">4</TD><TD> </TD><TD style="BACKGROUND-COLOR: #c0c0c0">CASO32</TD><TD style="BACKGROUND-COLOR: #c0c0c0; TEXT-ALIGN: right">4</TD><TD style="BACKGROUND-COLOR: #ccffcc"> </TD><TD style="BACKGROUND-COLOR: #ccffcc"> </TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">8</TD><TD style="TEXT-ALIGN: right">6/05/2011</TD><TD>Dog</TD><TD style="TEXT-ALIGN: right">9-0715</TD><TD style="BACKGROUND-COLOR: #ccccff">R4000</TD><TD style="TEXT-ALIGN: right">1</TD><TD> </TD><TD style="BACKGROUND-COLOR: #c0c0c0">CASO32</TD><TD style="BACKGROUND-COLOR: #c0c0c0; TEXT-ALIGN: right">0.5</TD><TD style="BACKGROUND-COLOR: #ccffcc">CASO33</TD><TD style="BACKGROUND-COLOR: #ccffcc; TEXT-ALIGN: right">0.5</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">9</TD><TD style="TEXT-ALIGN: right">6/05/2011</TD><TD>Cat</TD><TD style="TEXT-ALIGN: right">9-0705</TD><TD style="BACKGROUND-COLOR: #ccccff">R43000</TD><TD style="TEXT-ALIGN: right">10.75</TD><TD> </TD><TD style="BACKGROUND-COLOR: #c0c0c0">CASO32</TD><TD style="BACKGROUND-COLOR: #c0c0c0; TEXT-ALIGN: right">5.375</TD><TD style="BACKGROUND-COLOR: #ccffcc">CASO33</TD><TD style="BACKGROUND-COLOR: #ccffcc; TEXT-ALIGN: right">5.375</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">10</TD><TD style="TEXT-ALIGN: right">6/05/2011</TD><TD>Cat</TD><TD style="TEXT-ALIGN: right">9-0705</TD><TD style="BACKGROUND-COLOR: #ccccff">R30000</TD><TD style="TEXT-ALIGN: right">7.5</TD><TD> </TD><TD style="BACKGROUND-COLOR: #c0c0c0">CASO32</TD><TD style="BACKGROUND-COLOR: #c0c0c0; TEXT-ALIGN: right">3.75</TD><TD style="BACKGROUND-COLOR: #ccffcc">CASO33</TD><TD style="BACKGROUND-COLOR: #ccffcc; TEXT-ALIGN: right">3.75</TD></TR><TR style="HEIGHT: 19px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">11</TD><TD style="TEXT-ALIGN: right">7/05/2011</TD><TD>Rat</TD><TD style="TEXT-ALIGN: right">9-0805</TD><TD style="BACKGROUND-COLOR: #ccccff; TEXT-ALIGN: right">10</TD><TD style="TEXT-ALIGN: right">10</TD><TD> </TD><TD style="BACKGROUND-COLOR: #c0c0c0">CASO32</TD><TD style="BACKGROUND-COLOR: #c0c0c0; TEXT-ALIGN: right">5</TD><TD style="BACKGROUND-COLOR: #ccffcc">CASO33</TD><TD style="BACKGROUND-COLOR: #ccffcc; TEXT-ALIGN: right">5</TD></TR></TBODY></TABLE>

Excel tables to the web >> http://www.excel-jeanie-html.de/index.php?f=1" target="_blank"> Excel Jeanie HTML 4



Result I am trying to achieve.

Sheet2

<TABLE style="PADDING-RIGHT: 2pt; PADDING-LEFT: 2pt; FONT-SIZE: 11pt; FONT-FAMILY: Calibri,Arial; BACKGROUND-COLOR: #ffffff" cellSpacing=0 cellPadding=0 border=1><COLGROUP><COL style="FONT-WEIGHT: bold; WIDTH: 30px"><COL style="WIDTH: 64px"><COL style="WIDTH: 199px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"></COLGROUP><TBODY><TR style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"><TD> </TD><TD>A</TD><TD>B</TD><TD>C</TD><TD>D</TD><TD>E</TD><TD>F</TD></TR><TR style="HEIGHT: 19px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">1</TD><TD style="FONT-WEIGHT: bold; COLOR: #ffffff; BACKGROUND-COLOR: #33cccc; TEXT-ALIGN: center" rowSpan=2>Date Entered</TD><TD style="FONT-WEIGHT: bold; COLOR: #ffffff; BACKGROUND-COLOR: #33cccc; TEXT-ALIGN: center" rowSpan=2>Account Name/Description</TD><TD style="FONT-WEIGHT: bold; COLOR: #ffffff; BACKGROUND-COLOR: #33cccc; TEXT-ALIGN: center" rowSpan=2>GL/AC No.</TD><TD style="FONT-WEIGHT: bold; COLOR: #ffffff; BACKGROUND-COLOR: #33cccc; TEXT-ALIGN: center" rowSpan=2>Job No.</TD><TD style="FONT-WEIGHT: bold; COLOR: #ffffff; BACKGROUND-COLOR: #33cccc; TEXT-ALIGN: center" colSpan=2>Amount</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">2</TD><TD style="FONT-WEIGHT: bold; COLOR: #ffffff; BACKGROUND-COLOR: #33cccc; TEXT-ALIGN: center">Debit</TD><TD style="FONT-WEIGHT: bold; COLOR: #ffffff; BACKGROUND-COLOR: #33cccc; TEXT-ALIGN: center">Credit</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">3</TD><TD style="TEXT-ALIGN: center">1</TD><TD style="TEXT-ALIGN: center">2</TD><TD style="TEXT-ALIGN: center">3</TD><TD style="TEXT-ALIGN: center">4</TD><TD style="TEXT-ALIGN: center">5</TD><TD style="TEXT-ALIGN: center">6</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">4</TD><TD> </TD><TD style="FONT-SIZE: 10pt">Cat</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ccccff; TEXT-ALIGN: right">9-0705</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #c0c0c0">CASO32</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ffffcc; TEXT-ALIGN: right">$11.83</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ccffcc"> </TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">5</TD><TD> </TD><TD style="FONT-SIZE: 10pt">Cat</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ccccff; TEXT-ALIGN: right">9-0705</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #c0c0c0">CASO33</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ffffcc; TEXT-ALIGN: right">$11.83</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ccffcc"> </TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">6</TD><TD> </TD><TD style="FONT-SIZE: 10pt">Dog</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ccccff; TEXT-ALIGN: right">9-0715</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #c0c0c0">CASO32</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ffffcc; TEXT-ALIGN: right">$0.75</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ccffcc"> </TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">7</TD><TD> </TD><TD style="FONT-SIZE: 10pt">Dog</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ccccff; TEXT-ALIGN: right">9-0715</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #c0c0c0">CASO33</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ffffcc; TEXT-ALIGN: right">$1.88</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ccffcc"> </TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">8</TD><TD> </TD><TD style="FONT-SIZE: 10pt">Rat</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ccccff; TEXT-ALIGN: right">9-0805</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #c0c0c0">CASO32</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ffffcc; TEXT-ALIGN: right">$7.50</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ccffcc"> </TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">9</TD><TD> </TD><TD style="FONT-SIZE: 10pt">Rat</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ccccff; TEXT-ALIGN: right">9-0805</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #c0c0c0">CASO33</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ffffcc; TEXT-ALIGN: right">$7.50</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ccffcc"> </TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">10</TD><TD> </TD><TD style="FONT-SIZE: 10pt">Pig</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ccccff; TEXT-ALIGN: right">9-0710</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #c0c0c0">CASO32</TD><TD style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #ffffcc; TEXT-ALIGN: right">$4.00</TD><TD style="BACKGROUND-COLOR: #ccffcc"> </TD></TR></TBODY></TABLE>

Excel tables to the web >> http://www.excel-jeanie-html.de/index.php?f=1" target="_blank"> Excel Jeanie HTML 4
On your Sheet1...

Is CASO32 ALWAYS in the column labeled Job No. A and is CASO33 ALWAYS in the column labeled Job No. B?
 
Upvote 0
Hi Biff No these numbers can change depending on the job there could be 1, 2,3 or 4 different numbers in either columns Job No A or Job No B
 
Upvote 0
Hi Biff No these numbers can change depending on the job there could be 1, 2,3 or 4 different numbers in either columns Job No A or Job No B
Try this array formula**:

=SUM(IF(Sheet1!B$2:B$11=B4,IF(Sheet1!C$2:C$11=C4,((Sheet1!G$2:G$11=D4)*Sheet1!H$2:H$11)+((Sheet1!I$2:I$11=D4)*Sheet1!J$2:J$11))))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,834
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top