Unique Total Value Count per Unique Lookup Values

KnightVision

New Member
Joined
Jul 31, 2014
Messages
2
Hello all, I have a perplexing problem that I cannot solve, and would like to know if anyone could help. My sample data:

ABCDEFGHIJK
1Raw Data
2WO #Op #Serial #Program #NC Info# of KickoutKickout TypesCommentsUnique WO with NC PendingUnique Serials (per WO) with No NC - INCORRECT ANSWERUnique Serials (per WO) with No NC - DESIRED ANSWER
3WO-A1014a, 14b21001230004PAny Text168
4WO-B2015a, 15b21001230023CAny Text
5WO-C2016c2200NC Pending2SAny Text
6WO-D3017d2300Need NC1CAny Text
71010207002100No NC0Any Text
81010207202100No NC0Any Text
91010307402200, 2300No NC0Any Text
10102020Ser-012100No NC0Any Text
11102010Ser-012200No NC0Any Text
12102030Ser-022100No NC0Any Text
131030105002300No NC0Any Text
141030305002400No NC0Any Text
151030305002500No NC0Any Text
161010307202400No NC0Any Text
171010407402500No NC0Any Text
18101010Ser-012300No NC0Any Text
19101020Ser-012400No NC0Any Text
20101020Ser-012500No NC0Any Text
211020205002100No NC0Any Text

<tbody>
</tbody>

GIVEN:
Each WO can have multiple Serials. These Serials can be unique, repeated, or both (for a certain WO). Serials may also repeat across different WOs.

There are four categories for NC Info (a number, "NC Pending", "Need NC", and "No NC").

FIND:
Count the total number of unique Serials PER WO that meet the criteria of "No NC" in the NC Info column.

EXAMPLE:
• WO 1010 is listed 8 times in the WO # column.
• There are four different serials (700, 720, 740, Ser-01) for WO 1010.
• Serial 700 does not repeat FOR THIS UNIQUE WO. Serials 720, 740, and Ser-01 repeat FOR THIS UNIQUE WO.
• Thus, the number of unique Serials in WO 1010 that have the NC Info of "No NC" is 4. Notice that Ser-01 also shows up for WO 1020 twice. So Ser-01 will be counted once for WO 1010, and once for WO 1020.

I need to know the number of unique Serials (per WO) in total that meet the “No NC” criteria. Because some Serials may appear in more than one WO (where they may also repeat), the count for that Serial may or may not equal 1, but may increase if the Serial is in different WOs.

MORE INFO:
I have managed to use SUM(IF(FREQUENCY(IF… to successfully find the number of unique WOs that meet other NC Info categories, such as those with a number or those with “NC Pending”. Note that I was searching the WOs and not Serials. For example, to find all of the “NC Pending” WOs, I used:

Code:
{=SUM(IF(FREQUENCY(IF($E$3:$E$500="nc pending",MATCH($A$3:$A$500,$A$3:$A$500,0)),IF($E$3:$E$500="nc pending",MATCH($A$3:$A$500,$A$3:$A$500,0)))>0,1))}

Which returns the correct answer of 1 for my sample data.

The “No NC” scenario is different. I now want to search the Serials. I have tried the following formula in cell J3 but it does not give the correct answer.

Code:
{=SUM(IF(FREQUENCY(IF($E$3:$E$500="no nc",MATCH($C$3:$C$500, $C$3:$C$500,0)),IF($E$3:$E$500="no nc",MATCH($C$3:$C$500,$C$3:$C$500,0)))>0,1))}

The result of this formula is 6. As you can tell from my sample data, the correct result should be 8 (4 unique Serials for WO 1010, 3 unique Serials for WO 1020, and 1 unique Serial for WO 1030).

Thank you for your time and I would appreciate any help you can provide.
 
Last edited:

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.
1. Control+shift+enter, not just enter:
Rich (BB code):
=SUM(IF(FREQUENCY(IF($A$3:$A$21<>"",IF($E$3:$E$21="NC Pending",
  MATCH("~"&$A$3:$A$21,$A$3:$A$21&"",0))),ROW($A$3:$A$21)-ROW($A$3)+1),1))

2. Control=shift+enter, not just enter:
Rich (BB code):
=SUM(IF(FREQUENCY(IF($C$3:$C$21<>"",IF($E$3:$E$21="No NC",
  MATCH($C$3:$C$21&"|"&$A$3:$A$21,$C$3:$C$21&"|"&$A$3:$A$21,0))),
  ROW($C$3:$C$21)-ROW($C$3)+1),1))
 
Upvote 0

Forum statistics

Threads
1,215,575
Messages
6,125,632
Members
449,241
Latest member
NoniJ

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