Sum Product?

GeneJoseph

Board Regular
Joined
Feb 23, 2015
Messages
51
A B C
1 1/2/17 Meals $50
2 2/2/17 Office $100
3 Other $200

Sum C1:C3 IF B1:B3 AND IF A1:A3 occurred in 1(January). The answer should be $50. It should ONLY SUM C where B says meals (B1) and A says "1" (A1). I have tried some diff formulas but C was still being summed when A was empty although it did not when A was 2/1/17- not sure why. I only wanted it to sum row 1 (A,B,C)
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi,

E1 is your requested formula.
I recommend F1 formula using H1:I2 as your criterion if you might want to change what you want SUMmed.


Book1
ABCDEFGHI
11/2/2017Meals505050month to lookup1
22/2/2017Office100item to lookupmeals
3Other200
Sheet169
Cell Formulas
RangeFormula
E1=SUMPRODUCT((MONTH(A1:A3)=1)*(B1:B3="Meals")*C1:C3)
F1=SUMPRODUCT((MONTH(A1:A3)=I1)*(B1:B3=I2)*C1:C3)
 
Upvote 0
Hi,

E1 is your requested formula.
I recommend F1 formula using H1:I2 as your criterion if you might want to change what you want SUMmed.

ABCDEFGHI
Mealsmonth to lookup
Officeitem to lookupmeals
Other

<colgroup><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"]1/2/2017[/TD]

[TD="align: right"]50[/TD]
[TD="align: right"][/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"][/TD]

[TD="align: right"]1[/TD]

[TD="align: center"]2[/TD]
[TD="align: right"]2/2/2017[/TD]

[TD="align: right"]100[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]3[/TD]
[TD="align: right"][/TD]

[TD="align: right"]200[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
Sheet169

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]E1[/TH]
[TD="align: left"]=SUMPRODUCT((MONTH(A1:A3)=1)*(B1:B3="Meals")*C1:C3)[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]F1[/TH]
[TD="align: left"]=SUMPRODUCT((MONTH(A1:A3)=I1)*(B1:B3=I2)*C1:C3)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
Thank you, I will give it a shot !
 
Upvote 0
Hi,

E1 is your requested formula.
I recommend F1 formula using H1:I2 as your criterion if you might want to change what you want SUMmed.

ABCDEFGHI
Mealsmonth to lookup
Officeitem to lookupmeals
Other

<colgroup><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"]1/2/2017[/TD]

[TD="align: right"]50[/TD]
[TD="align: right"][/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"][/TD]

[TD="align: right"]1[/TD]

[TD="align: center"]2[/TD]
[TD="align: right"]2/2/2017[/TD]

[TD="align: right"]100[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]3[/TD]
[TD="align: right"][/TD]

[TD="align: right"]200[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
Sheet169

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]E1[/TH]
[TD="align: left"]=SUMPRODUCT((MONTH(A1:A3)=1)*(B1:B3="Meals")*C1:C3)[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]F1[/TH]
[TD="align: left"]=SUMPRODUCT((MONTH(A1:A3)=I1)*(B1:B3=I2)*C1:C3)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

I tried this but it still sums C when A is empty. I only want C to sum IF B1 is meals AND A1 = month 1
 
Upvote 0
We'll add another condition:


Book1
ABCDEFGHI
1Meals5000month to lookup1
22/2/2017Office100item to lookupmeals
3Other200
Sheet169
Cell Formulas
RangeFormula
E1=SUMPRODUCT((ISNUMBER(A1:A3))*(MONTH(A1:A3)=1)*(B1:B3="Meals")*C1:C3)
F1=SUMPRODUCT((ISNUMBER(A1:A3))*(MONTH(A1:A3)=I1)*(B1:B3=I2)*C1:C3)
 
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,189
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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