Converting Sum Formula To Not Count Duplicates In Array

psmi123

New Member
Joined
Jul 10, 2018
Messages
16
In the below formula I want to convert the Sum formula to not count for duplicates. I will explain this further.

=SUM(($BB$7:$BV$384)*(--(A7:A384=A16)*(B7:B384=B16)))

With the above formula I am summing the total dollar amounts in a range based on 2 criteria (2 other columns). I tried switching it to a SumProduct formula but its not letting me fit the array into more than one row.


=SUM(($BB$7:$BV$384)*(--(A7:A384=A16)*(B7:B384=B16)))

In ($BB$7:$BV$384) I am referencing the entire array which it can pull data from. I am trying to add up the dollar amounts in within the range without counting the duplicate dollar amounts.



=SUM(($BB$7:$BV$384)*(--(A7:A384=A16)*(B7:B384=B16)))

In (--(A7:A384=A16)I am referencing the first criteria which it must search for



=SUM(($BB$7:$BV$384)*(--(A7:A384=A16)*(B7:B384=B16)))

In (B7:B384=B16)I am referencing the second column of criteria


Is there any way to transform this sum formula to not count for duplicates?

Thanks in advance for the help!

-PS
 
Last edited:

Excel Facts

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

I based my answer on this post: https://www.mrexcel.com/forum/excel...-column-excluding-duplicates.html#post4000841
-> you'd need to add two extra conditions. I made a small sample and tested, the data is in D1:F8, column D is the column you want to sum, in E and F are the conditions:

=SUM(IF(FREQUENCY(IF(ISNUMBER(D1:D8),MATCH(D1:D8,D1:D8,0)),ROW(D1:D8)-ROW(D1)+1),D1:D8))
And adding two conditions:
=SUM(IF(FREQUENCY(IF(ISNUMBER(D1:D8),IF(E1:E8="A",IF(F1:F8="D",MATCH(D1:D8,D1:D8,0)))),ROW(D1:D8)-ROW(D1)+1),D1:D8))

Cheers,

Koen
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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