Grouping previous value in excel

Viewed 19

I need the formula to create the Mapping column in the below table

Id Name Group Mapping
1 Tyson1 A Tyson1
2 Tyson2 B Tyson2
3 Tyson3 C Tyson3
4 Tyson4 C Tyson 3, Tyson 4
5 Tyson5 D Tyson5
6 Tyson6 F Tyson6
7 Tyson7 C Tyson 3, Tyson 4, Tyson7
1 Answers

Use the following formula-

=TEXTJOIN(", ",TRUE,FILTER($B$2:$B2,$C$2:$C2=C2))

For dynamic spill array approach use-

=BYROW(C2:C8,LAMBDA(x,TEXTJOIN(", ",TRUE,FILTER(B2:B8,(C2:C8=x)*(ROW(C2:C8)<=ROW(x))))))

enter image description here

Related