Count unique values with multiple criteria and exclusions

AlexandraT

Board Regular
Joined
Mar 23, 2015
Messages
144
Hello,

I don't usually have to actually post a question here since I can usually find the answers I need in other posts. However, I am unable to find an answer now.

Here is my sample table:

ColourArticleSizeSold
Green
Dress

<tbody>
</tbody>
2
Apr-15

<tbody>
</tbody>
Green
Jumper

<tbody>
</tbody>
2
Feb-15

<tbody>
</tbody>
Green
Jumper

<tbody>
</tbody>
1
Feb-15

<tbody>
</tbody>
Green
Pants

<tbody>
</tbody>
1
May-15

<tbody>
</tbody>
Green
Skirt

<tbody>
</tbody>
2
May-15

<tbody>
</tbody>
Green
Skirt

<tbody>
</tbody>
1
Apr-15

<tbody>
</tbody>
Green
T-shirt

<tbody>
</tbody>
1
Feb-15

<tbody>
</tbody>
GreenT-shirt2
Feb-15

<tbody>
</tbody>
Red
Jumper

<tbody>
</tbody>
1
May-15

<tbody>
</tbody>
Red
Jumper

<tbody>
</tbody>
2
Mar-15

<tbody>
</tbody>
Red
Pants

<tbody>
</tbody>
1
Apr-15

<tbody>
</tbody>
Red
Pants

<tbody>
</tbody>
2
Feb-15

<tbody>
</tbody>
Red
Shorts

<tbody>
</tbody>
2
Mar-15

<tbody>
</tbody>
RedSkirt1
May-15

<tbody>
</tbody>
RedSocks1
May-15

<tbody>
</tbody>
RedSocks2
May-15

<tbody>
</tbody>

<tbody>
</tbody>

Looks a bit silly but it should help with that I need. So what I would need is to know how many types of clothes are green but not red and vice versa. I would also like these split by month. Also, how many green only types of clothes come in both sizes and how many red only types of clothes come in both sizes. Also by month.

To illustrate what I need (without taking into account the month):

Green only2(Dress,T-shirt)
Red only2(Shorts,Socks)
Red 2 sizes1(Socks)
Green 2 sizes1(T-shirt)

<tbody>
</tbody>

My data is some thousand rows long but there are 2 colours, 2 sizes and 4 months. There are thousands of types of clothes though.

I don't have any preference how this can be done, be it by additional columns, formula, pivot table or power pivot. But for the life of me I cannot figure it out and I can't seem to find anything online (granted I might not be searching properly).

Any help would be greatly appreciated. Thanks :)
 
did you mean this which is easily changed by using filters

Count of Article
SoldArticleColourSizeTotal
Feb-15JumperGreen11
21
Green Total2
Jumper Total2
T-shirtGreen11
21
Green Total2
T-shirt Total2
Feb-15 Total4
Apr-15DressGreen21
Green Total1
Dress Total1
SkirtGreen11
Green Total1
Skirt Total1
Apr-15 Total2
May-15PantsGreen11
Green Total1
Pants Total1
SkirtGreen21
Green Total1
Skirt Total1
May-15 Total2
Grand Total8

<tbody>
</tbody>

No. You see, on my list, regardless of month, there are both green jumpers and red jumpers. If there are both green and red jumpers, the jumpers do not fit the criteria of articles that are only red but not also green. Same goes for the pants. The t-shirts however are only green. there are no red t-shirts on the list, not in February nor any other month.That is why the t-shirts meet the criteria, Dresses are another one. There are only green dresses on the entire list regardless of month (no red dresses on the list). I hope that makes it clearer.
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,215,343
Messages
6,124,404
Members
449,156
Latest member
LSchleppi

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