Если у вас Windows Excel 2010+, вы можете использовать Power Query
с пользовательским столбцом, использующим функцию List.RemoveMatchingItems
.
М-код
Source = Excel.CurrentWorkbook(){[Name="Table6"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each List.RemoveMatchingItems(Text.Split([Column1],","),Text.Split([Column2],","))),
#"Extracted Values" = Table.TransformColumns(#"Added Custom", {"Custom", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
#"Added Custom1" = Table.AddColumn(#"Extracted Values", "Custom.1", each List.RemoveMatchingItems(Text.Split([Column2],","),Text.Split([Column1],","))),
#"Extracted Values1" = Table.TransformColumns(#"Added Custom1", {"Custom.1", each Text.Combine(List.Transform(_, Text.From), ","), type text})
in
#"Extracted Values1"