Sum Range of Values Related to Serial Number only if text does not appear in an adjacent column

doublecaesar

New Member
Joined
Mar 31, 2018
Messages
3
I'm currently working with a data set that includes Serial Numbers with a range of values to sum, but only if a 3rd column does not contain a specific text. Column D is the formula column that I am trying to figure out how to achieve.

[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Serial Number[/TD]
[TD]Distance[/TD]
[TD]Color[/TD]
[TD]Total Distance if All Blue[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1001[/TD]
[TD]10[/TD]
[TD]Blue[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1001[/TD]
[TD]10[/TD]
[TD]Blue[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1001[/TD]
[TD]10[/TD]
[TD]Blue[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]1002[/TD]
[TD]10[/TD]
[TD]Yellow[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]1002[/TD]
[TD]10[/TD]
[TD]Blue[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]1002[/TD]
[TD]10[/TD]
[TD]Blue[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]1003[/TD]
[TD]10[/TD]
[TD]Yellow[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]1003[/TD]
[TD]10[/TD]
[TD]Yellow[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]1003[/TD]
[TD]10[/TD]
[TD]Yellow[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]
I've been attempting Sumifs, however I keep coming back with a sum of all the B rows for each serial number that aren't yellow (1002 would be 20, 1003 would be zero).
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hi & welcome to the board.
How about


Excel 2013 32 bit
ABCD
1Serial NumberDistanceColorTotal Distance if All Blue
2100110Blue30
3100110Blue30
4100110Blue30
5100210Yellow20
6100210Blue20
7100210Blue20
8100310Yellow0
9100310Yellow0
10100310Yellow0
Members
Cell Formulas
RangeFormula
D2=SUMIFS(B$2:B$10,A$2:A$10,A2,C$2:C$10,"<>Yellow")
 
Upvote 0
Hi & welcome to the board.
How about

Excel 2013 32 bit
ABCD
Serial NumberDistanceColorTotal Distance if All Blue
Blue
Blue
Blue
Yellow
Blue
Blue
Yellow
Yellow
Yellow

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]

[TD="align: center"]2[/TD]
[TD="align: right"]1001[/TD]
[TD="align: right"]10[/TD]

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

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

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

[TD="align: center"]4[/TD]
[TD="align: right"]1001[/TD]
[TD="align: right"]10[/TD]

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

[TD="align: center"]5[/TD]
[TD="align: right"]1002[/TD]
[TD="align: right"]10[/TD]

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

[TD="align: center"]6[/TD]
[TD="align: right"]1002[/TD]
[TD="align: right"]10[/TD]

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

[TD="align: center"]7[/TD]
[TD="align: right"]1002[/TD]
[TD="align: right"]10[/TD]

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

[TD="align: center"]8[/TD]
[TD="align: right"]1003[/TD]
[TD="align: right"]10[/TD]

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

[TD="align: center"]9[/TD]
[TD="align: right"]1003[/TD]
[TD="align: right"]10[/TD]

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

[TD="align: center"]10[/TD]
[TD="align: right"]1003[/TD]
[TD="align: right"]10[/TD]

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

</tbody>
Members

[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=F0E0E0]#F0E0E0[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=F0E0E0]#F0E0E0[/URL] "]D2[/TH]
[TD="align: left"]=SUMIFS([COLOR=rgb(255]B$2:B$10,A$2:A$10,A2,C$2:C$10,"<>Yellow"[/COLOR])[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

Thanks for the quick response, that is basically where I had gotten. However I am needing the serial numbers in rows 5,6,7 to total as 0 because all the text values in the range are not Blue. Basically if any text besides Blue is in any of the rows that have the same serial number, I want it to not be summed and return as zero.
 
Upvote 0
So I've created a workaround - added a column for IF formula to get just Yellow Distance, and Blue Distance and then hidden them. Now my sumifs will pull zero.
 
Upvote 0

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

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