Sumifs / sumproduct that contains multiple columns

Joanneyu

New Member
Joined
Nov 9, 2019
Messages
1
Hi excel experts! I'm trying to use sumifs that contains multiple columns...So I want to get the value highlighted in red if Color1, Color2, and Color3 contains "red", based on its assigned values. I was trying SUMIFS and SUMPRODUCT, but couldn't really figure it out.[TABLE="width: 500"]
<tbody>[TR]
[TD]code[/TD]
[TD](columnA)
Color1[/TD]
[TD](columnB)
color1 value[/TD]
[TD](C)
color2[/TD]
[TD](D)
color2 value[/TD]
[TD](E)
color3[/TD]
[TD](F)
color3 value[/TD]
[TD]Red[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Red[/TD]
[TD]0.2[/TD]
[TD]Red[/TD]
[TD]0.5[/TD]
[TD]Blue[/TD]
[TD]0.3[/TD]
[TD]Sumifs=0.7[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Green[/TD]
[TD]0.3[/TD]
[TD]Red[/TD]
[TD]0.4[/TD]
[TD]Blue[/TD]
[TD]0.7[/TD]
[TD]=0.4[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Green[/TD]
[TD]0.9[/TD]
[TD]Red[/TD]
[TD]0.2[/TD]
[TD]Green[/TD]
[TD]0.1[/TD]
[TD]=0.2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Red[/TD]
[TD]0.1[/TD]
[TD]Blue[/TD]
[TD]0.2[/TD]
[TD]Green[/TD]
[TD]0.3[/TD]
[TD]=0.1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Blue[/TD]
[TD]0.8[/TD]
[TD]Blue[/TD]
[TD]0.1[/TD]
[TD]Blue[/TD]
[TD]0.2[/TD]
[TD]=0[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Welcome to the Board!

If your data starts in row 2, place this formula in cell G2 and copy down to G5:
Code:
=IF(A2="Red",B2,0)+IF(C2="Red",D2,0)+IF(E2="Red",F2,0)
 
Upvote 0
Welcome to the MrExcel board!

Another option, which is also easily extendable to more columns if required. Simply change G1 to get the sum for a different colour if you want.

<b>SUM</b><br /><br /><table border="1" cellspacing="0" cellpadding="0" style="font-family:Arial,Arial; font-size:8pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:56px;" /><col style="width:87px;" /><col style="width:54px;" /><col style="width:87px;" /><col style="width:54px;" /><col style="width:93px;" /><col style="width:50px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td >A</td><td >B</td><td >C</td><td >D</td><td >E</td><td >F</td><td >G</td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td style="font-size:10pt; ">Color1</td><td style="font-size:10pt; text-align:right; ">color1 value</td><td style="font-size:10pt; ">color2</td><td style="font-size:10pt; text-align:right; ">color2 value</td><td style="font-size:10pt; ">color3</td><td style="font-size:10pt; text-align:right; ">color3 value</td><td style="font-size:10pt; text-align:right; ">Red</td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td style="font-size:10pt; ">Red</td><td style="font-size:10pt; text-align:right; ">0.2</td><td style="font-size:10pt; ">Red</td><td style="font-size:10pt; text-align:right; ">0.5</td><td style="font-size:10pt; ">Blue</td><td style="font-size:10pt; text-align:right; ">0.3</td><td style="font-size:10pt; text-align:right; ">0.7</td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td style="font-size:10pt; ">Green</td><td style="font-size:10pt; text-align:right; ">0.3</td><td style="font-size:10pt; ">Red</td><td style="font-size:10pt; text-align:right; ">0.4</td><td style="font-size:10pt; ">Blue</td><td style="font-size:10pt; text-align:right; ">0.7</td><td style="font-size:10pt; text-align:right; ">0.4</td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >4</td><td style="font-size:10pt; ">Green</td><td style="font-size:10pt; text-align:right; ">0.9</td><td style="font-size:10pt; ">Red</td><td style="font-size:10pt; text-align:right; ">0.2</td><td style="font-size:10pt; ">Green</td><td style="font-size:10pt; text-align:right; ">0.1</td><td style="font-size:10pt; text-align:right; ">0.2</td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >5</td><td style="font-size:10pt; ">Red</td><td style="font-size:10pt; text-align:right; ">0.1</td><td style="font-size:10pt; ">Blue</td><td style="font-size:10pt; text-align:right; ">0.2</td><td style="font-size:10pt; ">Green</td><td style="font-size:10pt; text-align:right; ">0.3</td><td style="font-size:10pt; text-align:right; ">0.1</td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >6</td><td style="font-size:10pt; ">Blue</td><td style="font-size:10pt; text-align:right; ">0.8</td><td style="font-size:10pt; ">Blue</td><td style="font-size:10pt; text-align:right; ">0.1</td><td style="font-size:10pt; ">Blue</td><td style="font-size:10pt; text-align:right; ">0.2</td><td style="font-size:10pt; text-align:right; ">0</td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b>Spreadsheet Formulas</b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Formula</td></tr><tr><td >G2</td><td >=SUMIF(A2:E2,G$1,B2:F2)</td></tr></table></td></tr></table>
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,189
Members
452,616
Latest member
intern444

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