Here are two functions to accomplish this. One I wrote called CompareLists() and it is a UDF. Here's the code, it goes in a standard code module, not a sheet module:
Once installed you use it in a cell like any other formula, in C2:
=COMPARELISTS(A2, B2, ",", TRUE)
RANGE1 - the first delimited list in a cell. Only the first cell will be used if this is a multicell range
RANGE2 - the second delimited list in another cell. Only the first cell will be used if this is a multicell range
DELIMITER - an optional string that indicates the delimiter in each comparison cell, the default is comma
TRUE/FALSE - optional, if TRUE is a list of common items, if FALSE or omitted is a list of non-common items
The second function is a BubbleSort function using a popular technique that is used to "sort an array in vba", it is putting the results into alphabetical order as you requested.
Bookmarks