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.
code(columnA)
Color1
(columnB)
color1 value
(C)
color2
(D)
color2 value
(E)
color3
(F)
color3 value
Red
1Red0.2Red0.5Blue0.3Sumifs=0.7
2Green0.3Red0.4Blue0.7=0.4
3Green0.9Red0.2Green0.1=0.2
4Red0.1Blue0.2Green0.3=0.1
5Blue0.8Blue0.1Blue0.2=0

<tbody>
</tbody>
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
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,213,534
Messages
6,114,185
Members
448,554
Latest member
Gleisner2

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