Sum two columns, duplicates count as one

NHagedorn

New Member
Joined
May 11, 2012
Messages
24
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>
 

Some videos you may like

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
17,234
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Assuming your values are either 0 or 1 for both columns:
Excel Workbook
ABCD
1107
210
311
401
501
600
710
811
Sheet1
 

NHagedorn

New Member
Joined
May 11, 2012
Messages
24
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:

NHagedorn

New Member
Joined
May 11, 2012
Messages
24
=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?
 

Watch MrExcel Video

Forum statistics

Threads
1,109,435
Messages
5,528,746
Members
409,833
Latest member
tdnhan

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top