Forum Discussion

rtayerst's avatar
rtayerst
Copper Contributor
Nov 04, 2024

Filter results into 2 columns

Hi all,   I think this should be relatively straight forward, but can't find a simple solution...My data has 2 columns, a week of the year and a 'score'   I need to create a spill result (so I ca...
  • HansVogelaar's avatar
    HansVogelaar
    Nov 04, 2024

    rtayerst 

    For example:

     

    =LET(weeks, UNIQUE(A2:A10), HSTACK(weeks, BYROW(weeks, LAMBDA(cell, FILTER(C2:C10, (A2:A10=cell)*(B2:B10=2)*(C2:C10<=50), ""))), BYROW(weeks, LAMBDA(cell, FILTER(C2:C10, (A2:A10=cell)*(B2:B10=2)*(C2:C10>50), "")))))

     

    or formatted differently

    =LET(
      weeks, UNIQUE(A2:A10),
      HSTACK(
        weeks,
        BYROW(
          weeks,
          LAMBDA(cell,
            FILTER(
              C2:C10, 
              (A2:A10=cell)*(B2:B10=2)*(C2:C10<=50), 
              ""
            )
          )
        ),
        BYROW(
          weeks,
          LAMBDA(cell,
            FILTER(
              C2:C10, 
              (A2:A10=cell)*(B2:B10=2)*(C2:C10>50), 
              ""
            )
          )
        )
      )
    )

Resources