Sum two columns, duplicates count as one

NHagedorn

New Member
Joined
May 11, 2012
Messages
37
Office Version
  1. 365
Platform
  1. Windows
How do I sum two columns counting duplicates between the two columns as one? Is this a countif?

Thank you,
Nate

ABCD
1 AB
2Total=7 10
3 10
4 11
5 01
6 01
7 00
8 10
9 11

<colgroup><col width="64" span="5" style="width:48pt"> </colgroup><tbody>
</tbody>
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Assuming your values are either 0 or 1 for both columns:
Excel Workbook
ABCD
1107
210
311
401
501
600
710
811
Sheet1
 
Upvote 0
Awesome. Works great. What if I wanted to add an additional criteria? Red

Thought I could figure it out, but no luck.

Thank you,
Nate

CellFormula D1=SUM(A1:B8)-SUMPRODUCT((A1:A8=1)*(B1:B8=1))



ABCD EFGHI
110red7blue5
210redred 2
311blue
401red
501red
600blue
710blue
811red

<tbody>
</tbody>
 
Last edited:
Upvote 0
=SUMIF(C:C,"Red",A:A)+SUMIF(C:C, "Red",B:B)-SUMPRODUCT((A:A=1)*(B:B=1)*(C:C="Red"))

Better, Cleaner way?
 
Upvote 0

Forum statistics

Threads
1,214,570
Messages
6,120,296
Members
448,954
Latest member
EmmeEnne1979

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