Search code examples
google-sheetsfiltergoogle-sheets-formulafilteringflatten

Filtering a Non-Unique Data Set in Google Sheets


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)?

https://docs.google.com/spreadsheets/d/1Ire32u7kELCAu07AHiTGt8yoXwCWDpvT77nQYSN21DU/edit#gid=0

This is the sample case

  1. A2:B7 is the list of recipe
  2. D2:D7 is the list of menu sold
  3. F2:F13 is the desired result

Arrayformula is preferred since I don't have to drag down again when the data set get bigger.


Solution

  • try:

    =FLATTEN(BYROW(D2:D7, LAMBDA(x, TRANSPOSE(FILTER(A2:A7, B2:B7=x)))))
    

    enter image description here