That is great. Many thanks.

Is it possible to remove the redundant rows as in my example? At the moment:

1 a
1 b
1 c
2 a
2 c
2 d

Turns into

1 a b c
1
2 a c d
2
2

I would like to get to

1 a b
2 a c d