0

I'm looking for an excel based formula for one of my projects which can help in removing certain parts of a cell (Cell A - names separated by a based on the values in Cell B (similar format as Cell A). I'm running a flow on this file as well hence cannot run VBA based solutions as my connector is excel online.

Example

Cell A - cat;dog;rat;rabbit

Cell B - rabbit;dog

Result needs to be - cat;rat

1 Answers1

0

For O365 Beta Channel:

=TEXTJOIN(";",,UNIQUE(TEXTSPLIT(A1&";"&B1,,";"),,1))

All O365 users (though works only in the desktop version, not online):

=TEXTJOIN(";",,UNIQUE(FILTERXML("<a><b>"&SUBSTITUTE(A1&";"&B1,";","</b><b>")&"</b></a>","//b"),,1))

For Excel Online:

=TEXTJOIN(";",,UNIQUE(TRIM(MID(SUBSTITUTE(A1&";"&B1,";",REPT(" ",99)),99*SEQUENCE(1+LEN(A1&";"&B1)-LEN(SUBSTITUTE(A1&";"&B1,";","")),,0)+1,99)),,1))

Jos Woolley
  • 8,564
  • 2
  • 4
  • 9