Count if unique combination

Danielv

New Member
Joined
Aug 16, 2015
Messages
1
Hi guys,
could really use some help creating a complicated Indices file.
i am attempting to count the number of setup events for a given machine.
my Indices are setup in one tab, and all the data in a second tab.
the data tab is built as follows:

[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]Machine[/TD]
[TD]Date[/TD]
[TD]Order Number[/TD]
[TD]Event[/TD]
[TD].......[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

usual this would be simple counting the number of "Setup" events for any Given Machine, however i have duplicates due to improper data input or workers taking a break during a setup (event number 5) and the resuming a setup.

I need to be able to count the number of "2" events corresponding to two unique identifiers, "Order Number" and "Machine".
keep in mind these are large files with several thousand entry's....

for example: (Filtered for machine AM-21)
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD][TABLE="width: 113"]
<tbody>[TR]
[TD="width: 113, align: left"]AM-21[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]27/10/2014[/TD]
[TD][TABLE="width: 113"]
<tbody>[TR]
[TD="width: 113, align: left"]A98771[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD][TABLE="width: 113"]
<tbody>[TR]
[TD="width: 113, align: left"]AM-21[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]27/10/2014[/TD]
[TD][TABLE="width: 113"]
<tbody>[TR]
[TD="width: 113, align: left"]A98771[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]AM-21[/TD]
[TD]27/10/2014[/TD]
[TD][TABLE="width: 113"]
<tbody>[TR]
[TD="width: 113, align: left"]A98736[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]AM-21[/TD]
[TD]27/10/2014[/TD]
[TD][TABLE="width: 113"]
<tbody>[TR]
[TD="width: 113, align: left"]A97202[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]AM-21[/TD]
[TD]27/10/2014[/TD]
[TD][TABLE="width: 113"]
<tbody>[TR]
[TD="width: 113, align: left"]A97202[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]AM-21[/TD]
[TD]27/10/2014[/TD]
[TD][TABLE="width: 113"]
<tbody>[TR]
[TD="width: 113, align: left"]A97202[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]AM-21[/TD]
[TD]27/10/2014[/TD]
[TD][TABLE="width: 113"]
<tbody>[TR]
[TD="width: 113, align: left"]A97202[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]AM-21[/TD]
[TD]27/10/2014[/TD]
[TD]A094449[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]AM-21[/TD]
[TD]27/10/2014[/TD]
[TD]A094449[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]AM-21[/TD]
[TD]27/10/2014[/TD]
[TD]A094449[/TD]
[TD]2[/TD]
[/TR]
</tbody>[/TABLE]
(1-Work, 2-SU, 5-Break)

in this example only the highlighted rows should be counted (3).
Also counting the number of unique Order numbers is not a good indicate as some orders don't have setups.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
If I read your question well, with a pivot table.


Book1
ABCDEFGH
1AMdatejobcountcriteriacriteriayes
2AM-2127-10-2014A987711yes
3AM-2127-10-2014A987361yesRijlabelsTelling van count
4AM-2127-10-2014A972021yesA0944491
5AM-2127-10-2014A972022NOA972022
6AM-2127-10-2014A972021yesA987361
7AM-2127-10-2014A0944495yesA987711
8AM-2127-10-2014A0944492NOEindtotaal5
Blad8
Cell Formulas
RangeFormula
E2=IF(D2=2,"NO","yes")
E3=IF(D3=2,"NO","yes")
E4=IF(D4=2,"NO","yes")
E5=IF(D5=2,"NO","yes")
E6=IF(D6=2,"NO","yes")
E7=IF(D7=2,"NO","yes")
E8=IF(D8=2,"NO","yes")
 
Upvote 0

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

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