Home > Back-end >  filtering dynamically a table In Excel
filtering dynamically a table In Excel

Time:11-29

Is there a way to have a dynamic array formula that gives the solution as per cells A11:B12 out of the Table A1:B6. enter image description here

• Formula used in cell A10

=HSTACK(UNIQUE(Table23[Client]),BYROW(UNIQUE(Table23[Client]),LAMBDA(x,TEXTJOIN(",",,REPT(Table23[Product],x=Table23[Client])))))

You can wrap the whole within a LET() to make it more readable, like as below,

enter image description here

• Formula used in cell A10

=LET(_client,UNIQUE(Table23[Client]),
HSTACK(_client,BYROW(_client,LAMBDA(x,TEXTJOIN(",",,REPT(Table23[Product],x=Table23[Client]))))))

You can use a FILTER() function in place of REPT()

enter image description here

• Formula used in cell A10

=LET(_client,UNIQUE(Table23[Client]),
HSTACK(_client,BYROW(_client,LAMBDA(x,TEXTJOIN(",",,FILTER(Table23[Product],x=Table23[Client]))))))

You can also try in this way as well,

enter image description here

• Formula used in cell A9

=DROP(IFERROR(REDUCE("",UNIQUE(Table23[Client]),LAMBDA(a,b,VSTACK(a,HSTACK(b,TEXTJOIN(",",1,FILTER(Table23[Product],Table23[Client]=b)))))),""),1)
  • Related