A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Hello Gladys Chan
The total is overstated because four styles appear under both Sample Type A and B, so their quantities are counted twice.
Assuming duplicated styles should use Type B, please add two helper columns:
Selected Type:
=IF(COUNTIFS($A:$A,A2,$B:$B,"B")>0,"B","A")
Valid Qty:
=IF(AND(B2=E2,COUNTIFS($A$2:A2,A2,$B$2:B2,B2)=1),C2,0)
Then calculate the quantity-weighted Average MU%:
=IFERROR(SUMPRODUCT(F:F,D:D)/SUM(F:F),0)
Assuming that: Columns A–D contain Style, Sample Type, Qty and MU%. Columns E–F are the new Selected Type and Valid Qty columns.
The valid quantity should be 219,000 pcs, not 231,000 pcs. Assuming whether Type B should always be selected when a style appears under both A and B.
Please let me know if you have any further questions.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.