Home > Blockchain >  Filtering a Non-Unique Data Set in Google Sheets
Filtering a Non-Unique Data Set in Google Sheets

Time:01-29

I have a list of recipe, and I also have a list of sold menu. Is there any way that can filter the recipe (can be with query, or not) by looking at the menu (that can repeat more than once)?

enter image description here

CodePudding user response:

In case you have unmatching amount of items per menu (I added two extra elements to tenderloin), you can try this other option so you don't have empty spaces:

=TRANSPOSE(SPLIT(JOIN(",",BYROW(D2:D,LAMBDA(r,IF(r="",,JOIN(",",FILTER(A2:A, B2:B=r)))))),","))

enter image description here

CodePudding user response:

Another solution using REDUCE:

=REDUCE("recipe used",D2:D10,LAMBDA(a,c,{a;FILTER(A2:A10,B2:B10=c)}))
  • Related