Reputation: 35
I have an excel list of school courses that needs to be transposed/merged, the data looks like this
I want it to look like this
Is this possible without VBA?
Upvotes: 1
Views: 241
Reputation: 481
With Excel 365. D2:
=INDEX(UNIQUE(A$2:A$8),ROW(A1))&" "&TEXTJOIN(", ",,FILTER(B:B,A:A=INDEX(UNIQUE(A$2:A$8),ROW(A1))))
or older version: Format Column A using this format text. E2:
=D2&SUBSTITUTE(PHONETIC(OFFSET(A$1,MATCH(D2,A:A,)-1,,COUNTIF(A:A,D2),2)),D2," ")
English is not my native language; please excuse typing errors.This is for your reference only.
Upvotes: 2
Reputation: 152505
With Office 365 we can use UNIQUE to get a list of unique Row Labels:
=UNIQUE(A2:A9)
With 2019 one would have to get the Unique list with:
=IFERROR(INDEX(A:A,AGGREGATE(15,7,ROW($A$2:$A$9)/(COUNTIF($E$1:E1,$A$2:$A$9)=0),1)),"")
Then use TEXTJOIN to do the concatenation:
=E2&" " &TEXTJOIN(", ",TRUE,FILTER(B:B,A:A=E2,""))
With 2016 use the formula for the unique list from 2019 and then use the method here: Outputting multiple VLookup values in Excel
To use a helper column then use:
=E2&" "&VLOOKUP(E2,A:C,3,FALSE)
to return the desired value:
Upvotes: 4