Looking for an Excel Formula

Copper Contributor

Hello Everyone,


I have 2 Colomns Supplier and Code . i need a formula that can change the position of a cell in colomn B if there is a duplication in colomn A.

The output of the formula should be like the 2nd table i have made it manually.


Thank you Guys :smiling_face_with_smiling_eyes:


3 Replies

@Khaledbarketi  The simplest of answers is something like =TRANSPOSE(FILTER(colB, colA=cellToTheLeft)) so assuming columns A, B for input and the output in col D (suppliers) and this formula in E2 then 


and fill down



Perhaps with REDUCE:


=LAMBDA(a,v,LET(filtered, FILTER(Code, Supplier = v), IFERROR(VSTACK(a, HSTACK(v, TOROW(filtered))), "")))