Is it possible to concatenate cells in a column dependent on values (ID
) in another column, and then output as a string (possibly in another sheet as it would be cleaner)?
E.g.
ID Text
1234 a
1234 b
1234 c
4321 a
4321 b
4321 c
4321 d
Output:
1234 a b c
4321 a b c d
Issues:
- Column IDs aren't in order (but can be sorted).
- Different amounts of each ID
This seemed like a possible VBA
solution
from How to merge rows in a column into one cell in excel?
Function JoinXL(arr As Variant, Optional delimiter As String = " ")
'arr must be a one-dimensional array.
JoinXL = Join(arr, delimiter)
End Function
Example usage:
=JoinXL(TRANSPOSE(A1:A4)," ")
So I thought maybe if INDEX
and MATCH
etc could be used in conjuction with TRANSPOSE
it could work. Just not sure how to go about it.
I can have a column of the unique IDs in another sheet.