Count unique multiple values once with criteria

L

Legacy 469343

Guest
Hi! What formula do I need to count a PO once if all the items of one PO have been delivered (marked X)?

P.S.: Unfortunately I'm on my office PC, so XL2BB cannot be downloaded...
 

Attachments

  • 1.png
    1.png
    11.3 KB · Views: 15
Sorry, based on my example, do you want a 2 in cell B2?

varios 19jun2021.xlsm
ABCD
1PosDel Po
232
3CompanyPOItemDelivered
4comp111X
5comp221X
6comp222X
7comp223X
8comp224
9comp225
10comp331X
11comp332X
12comp333X
13comp334X
14comp335X
15comp336X
Hoja6
Sorry, based on my example, do you want a 2 in cell B2?

varios 19jun2021.xlsm
ABCD
1PosDel Po
232
3CompanyPOItemDelivered
4comp111X
5comp221X
6comp222X
7comp223X
8comp224
9comp225
10comp331X
11comp332X
12comp333X
13comp334X
14comp335X
15comp336X
Hoja6
Yes that should be the outcome
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
What is C2 supposed to represent? A2 - B2 is my guess.
 
Upvote 0
Yes that should be the outcome
Try this:

Dante Amor
ABCD
1PosDel PoPen PO
2642
3CompanyPOItemDelivered
4comp111X
5comp221X
6comp222X
7comp223X
8comp224
9comp225
10comp331X
11comp332X
12comp333X
13comp334X
14comp335X
15comp336X
16comp441X
17comp442X
18comp551
19comp661X
20comp662X
Dante Amor
Cell Formulas
RangeFormula
A2A2=SUM(--(FREQUENCY(B4:B20,B4:B20)>0))
B2B2=A2-SUM(--(FREQUENCY(B4:B20,B4:B20)-FREQUENCY(IF(D4:D20="X",B4:B20),B4:B20)>0))
C2C2=A2-B2
Press CTRL+SHIFT+ENTER to enter array formulas.


With table1
Dante Amor
ABCD
1PosDel PoPen PO
2321
3CompanyPOItemDelivered
4comp111X
5comp221X
6comp222X
7comp223X
8comp224
9comp225
10comp331X
11comp332X
Dante Amor
Cell Formulas
RangeFormula
A2A2=SUM(--(FREQUENCY(Table1[PO],Table1[PO])>0))
B2B2=A2-SUM(--(FREQUENCY(Table1[PO],Table1[PO])-FREQUENCY(IF(Table1[Delivered]="X",Table1[PO]),Table1[PO])>0))
C2C2=A2-B2
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Last edited:
Upvote 0
Solution
Try this:

Dante Amor
ABCD
1PosDel PoPen PO
2642
3CompanyPOItemDelivered
4comp111X
5comp221X
6comp222X
7comp223X
8comp224
9comp225
10comp331X
11comp332X
12comp333X
13comp334X
14comp335X
15comp336X
16comp441X
17comp442X
18comp551
19comp661X
20comp662X
Dante Amor
Cell Formulas
RangeFormula
A2A2=SUM(--(FREQUENCY(B4:B20,B4:B20)>0))
B2B2=A2-SUM(--(FREQUENCY(B4:B20,B4:B20)-FREQUENCY(IF(D4:D20="X",B4:B20),B4:B20)>0))
C2C2=A2-B2
Press CTRL+SHIFT+ENTER to enter array formulas.


With table1
Dante Amor
ABCD
1PosDel PoPen PO
2321
3CompanyPOItemDelivered
4comp111X
5comp221X
6comp222X
7comp223X
8comp224
9comp225
10comp331X
11comp332X
Dante Amor
Cell Formulas
RangeFormula
A2A2=SUM(--(FREQUENCY(Table1[PO],Table1[PO])>0))
B2B2=A2-SUM(--(FREQUENCY(Table1[PO],Table1[PO])-FREQUENCY(IF(Table1[Delivered]="X",Table1[PO]),Table1[PO])>0))
C2C2=A2-B2
Press CTRL+SHIFT+ENTER to enter array formulas.
This did the trick! Thanks!
 
Upvote 0
This did the trick! Thanks!

=A2-SUM(--(FREQUENCY(Table1[PO],Table1[PO])-FREQUENCY(IF(Table1[Delivered]="X",Table1[PO]),Table1[PO])>0))
In fact, what the formula does is find the incomplete orders, so of the total orders minus the incomplete ones, we have the complete ones.

What formula do I need to count a PO once if all the items of one PO have been delivered (marked X)?
So if we change the focus to finding the incomplete ones (and we stop fighting for the complete ones, which is more complicated), the formula can be simplified like this:

Excel Formula:
=A2-SUM(--(FREQUENCY(IF(Table1[Delivered]="",Table1[PO]),Table1[PO])>0))

Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,848
Messages
6,121,917
Members
449,055
Latest member
KB13

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