Consider the following table in Excel:
status | order | attribute
---------------------------
purchased| table | brown
purchased| table | yellow
purchased| table |
purchased| sofa |
purchased| sofa | green
purchased| sofa |
purchased| pillow| brown
purchased| pillow| yellow
purchased| pillow|
shipped | lamp |
shipped | lamp |
shipped | lamp |
shipped | desk | brown
shipped | desk |
shipped | desk |
I am trying to count each order
by the attributes
, so I can get a summary of the following data:
- Number of unique
orders
with noattributes
- Number of unique
orders
where oneorder
has thebrown
attribute
but no otherattributes
- Number of unique
orders
where oneorder
has thebrown
attribute
and another has theyellow
attribute
and so on. Ideally these numbers could also be split by status
as well.
But based on the above table, the summary should look like this:
- Number of unique
orders
with noattributes
: 1 (lamp) - Number of unique
orders
where oneorder
has thebrown
attribute
but no otherattributes
: 1 (desk) - Number of unique
orders
where oneorder
has thebrown
attribute
and another has theyellow
attribute
: 2 (table and pillow)
I've been Googling and testing for hours but to no avail.