Forum Discussion
arianegr
Jul 26, 2021Copper Contributor
Count unique values in range
Hi I want to work out how many unique ingredients are in the Vegan restaurant, which are not in the Main Restaurant. For instance here in recipe 1 - there is 1 unique ingredient (tofu - as 'avocado...
arianegr
Jul 26, 2021Copper Contributor
Hi mtarler ,
Thank you very much for your input.
I used the first equation. When testing it by adding a third recipe - I found that it seems to double count tofu.
For clarification, I want to count the incremental unique amount of vegan ingredients which are NOT used in the main restaurant.
In the file attached, seems like it double counts tofu if it's being used in another vegan recipe - see file attached.
I think we are nearly there!
mtarler
Jul 26, 2021Silver Contributor
arianegr Ah, you want it to be incremental, that is the part I didn't get. That said you needed to make a variation of the second formula that was for the total. I bet there is an 'easier' version but this is what I came up with:
=SUMPRODUCT(((COUNTIFS($C$6:$E$8,$C$2:C5)+ISBLANK($C$2:C5))=0)/(COUNTIFS($C$2:C5,$C$2:C5)+ISBLANK($C$2:C5)))