COUNT DUPLICATES IN MULTIPLE CRITERIA

msalas0308

New Member
Joined
Sep 30, 2020
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Hello. I am trying to find the correct formula to count duplicate entries with multiple criteria's. See example below.

I need a formula to count all Orders in a spreadsheet that has certain words in that column as well is certain words in another column.

I need to find out how many Orders I have in Column "D" (counting duplicate Orders as 1), that have a Plant Section of MPC, SRU, CK1, and CK2 in Column "B" with a Priority of 2 in Column "C". My answer would be 4 if I had the correct formula.


2020 Sched Compliance Metrics.xlsx
BCD
1Plant SectionPriorityOrder
4SRU260981719
5SRU260981719
6SRU260981719
7CK2261594103
8CK2261594103
9CK2261594103
11MPC261627849
12EBKF61826948
13EBKF61826948
14WBK261855688
15CK1161911814
16MPC261911823
17MPC261911823
18MPC261911823
19MPC261911823
21WWTF61924403
22WWTF61924403
23CK2161983723
24WBK261990374
25EBK162017883
27WBK262031194
28EBK262040503
WK 33
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Ok, so what you need to do is add an extra column that has a unique item based on your 3 inputs by concatenate your data. For instance in E4 you want to type = B4&"-"&C4"-"&D4. This will give you a key from which to work on. You then need to a countif in column F. If you type in F4 the following = COUNIF($E$4:$E$28,E4). Copy that formula down and hey presto! This will tell you which are duplicates.

Hope that helps!
 
Upvote 0
I created a help using UNIQUE. Does this do it?

Book2
ABCDEFGHI
1Plant SectionPriorityOrder
2SRU260981719SRU2609817194
3SRU260981719CK2261594103
4SRU260981719MPC261627849
5CK2261594103EBKF61826948
6CK2261594103WBK261855688
7CK2261594103CK1161911814
8MPC261627849MPC261911823
9EBKF61826948WWTF61924403
10EBKF61826948CK2161983723
11WBK261855688WBK261990374
12CK1161911814EBK162017883
13MPC261911823WBK262031194
14MPC261911823EBK262040503
15MPC261911823
16MPC261911823
17WWTF61924403
18WWTF61924403
19CK2161983723
20WBK261990374
21EBK162017883
22WBK262031194
23EBK262040503
24
Sheet1
Cell Formulas
RangeFormula
E2:G14E2=UNIQUE(A2:C23)
I2I2=SUMPRODUCT(((E:E="SRU")+(E:E="MPC")+(E:E="CK1")+(E:E="CK2"))*(F:F=2))
Dynamic array formulas.
 
Upvote 0
Since you have Excel 365 here is an option without helper columns.

Book1
ABCDE
1Plant SectionPriorityOrder
2
3Count
4SRU2609817194
5SRU260981719
6SRU260981719
7CK2261594103
8CK2261594103
9CK2261594103
10
11MPC261627849
12EBKF61826948
13EBKF61826948
14WBK261855688
15CK1161911814
16MPC261911823
17MPC261911823
18MPC261911823
19MPC261911823
20
21WWTF61924403
22WWTF61924403
23CK2161983723
24WBK261990374
25EBK162017883
26
27WBK262031194
28EBK262040503
Sheet4
Cell Formulas
RangeFormula
E4E4=ROWS(UNIQUE(FILTER($C$4:$C$28,($B$4:$B$28=2)*(($A$4:$A$28="MPC")+($A$4:$A$28="SRU")+($A$4:$A$28="CK1")+($A$4:$A$28="CK2")))))
 
Upvote 0
Another option that is slightly more compact and also will return a count of zero rather than an error if nothing meets the criteria.

20 10 06.xlsm
BCDEF
1Plant SectionPriorityOrder
2
3Count
4SRU2609817194
5SRU260981719
6SRU260981719
7CK2261594103
8CK2261594103
9CK2261594103
10
11MPC261627849
12EBKF61826948
13EBKF61826948
14WBK261855688
15CK1161911814
16MPC261911823
17MPC261911823
18MPC261911823
19MPC261911823
20
21WWTF61924403
22WWTF61924403
23CK2161983723
24WBK261990374
25EBK162017883
26
27WBK262031194
28EBK262040503
count
Cell Formulas
RangeFormula
F4F4=COUNT(UNIQUE(FILTER(D4:D28,(C4:C28=2)*(ISNUMBER(FIND("|"&B4:B28&"|","|MPC|SRU|CK1|CK2|"))))))
 
Upvote 0
Peter_SSs - It says "That function isn't valid".
Does it give any indication about what part of the formula is the problem?

What happens if you click this icon ...
1602053301036.png

... at the top of my screen shot and then select cell B1 on a blank sheet and Paste?

Do you have the FILTER and UNIQUE functions in your version of Excel 365?
 
Upvote 0
Does it give any indication about what part of the formula is the problem?
I've seen people getting that message when trying to use the Filter function, if they don't have it. So suspect that the OP does not have the latest updates.
 
Upvote 0
I've seen people getting that message when trying to use the Filter function, if they don't have it.
Thanks for that. Strange message though as you would think that then the FILTER function should return #NAME? & therefore simply be ignored by by the COUNT function. I had tried putting an obviously incorrect function name in place of FILTER and my formula simply returned 0.

In any case, if FILTER is not available then neither will UNIQUE, so perhaps this might do the job?

msalas0308.xlsm
BCDEF
1Plant SectionPriorityOrder
2
3Count
4SRU2609817194
5SRU260981719
6SRU260981719
7CK2261594103
8CK2261594103
9CK2261594103
10
11MPC261627849
12EBKF61826948
13EBKF61826948
14WBK261855688
15CK1161911814
16MPC261911823
17MPC261911823
18MPC261911823
19MPC261911823
20
21WWTF61924403
22WWTF61924403
23CK2161983723
24WBK261990374
25EBK162017883
26
27WBK262031194
28EBK262040503
Sheet1
Cell Formulas
RangeFormula
F4F4=SUM(N(FREQUENCY(IF(ISNUMBER(MATCH(B4:B28,{"MPC","SRU","CK1","CK2"},0)),IF(C4:C28=2,D4:D28)),D4:D28)>0))
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,305
Members
449,079
Latest member
juggernaut24

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