How to count unique values with few criterias between two lists/ Count the number of duplicates with few criterias bwtween two lists

jychuah

New Member
Joined
Jul 27, 2017
Messages
1
For example, I have two list, each with three columns of criteria. From here I want to find the number of unique customer ID that bought orange on Wednesdays.


List 1

[TABLE="class: k-table, width: 844"]
<tbody>[TR]
[TD]Customer ID (Column A)[/TD]
[TD]Items bought (Column B)[/TD]
[TD]Day (Column C)[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Orange[/TD]
[TD]Wednesday[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Apple[/TD]
[TD]Tuesday[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Pear[/TD]
[TD]Wednesday[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Orange[/TD]
[TD]Wednesday[/TD]
[/TR]
</tbody>[/TABLE]

List 2

[TABLE="class: k-table, width: 844"]
<tbody>[TR]
[TD]Customer ID (Column E)[/TD]
[TD]Items bought (Column F)[/TD]
[TD]Day (Column G)[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Orange[/TD]
[TD]Wednesday[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Orange[/TD]
[TD]Friday[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Pear[/TD]
[TD]Thursday[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Orange[/TD]
[TD]Wednesday[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Orange [/TD]
[TD]Wednesday[/TD]
[/TR]
</tbody>[/TABLE]
I have tried the approach of minus off the duplicates by using the formula below to count the duplicates:
=SUM(IF(((F2:F6="Topup")*(G2:G6="Pass")),1/COUNTIFS(E2:E6,A2:A5,B2:B5,"Topup",C2:C5,"Pass"),0))
However, it does not work well and it gives me DIV/0! error.

Can anyone please help me with this approach or suggest me a new approach?


Many thanks,
jy
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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