Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Replacing only exact matches in Google Sheets with regex

I am trying to look at two lists of items and remove the items from one list on another in Google Sheets. The problem is that some of the items are enclosed in the others.
Working
Available (A1:1): Apples, Oranges, Grapes, Pears
Taken (B1:1): Apples, Grapes
Desired output (still available): Oranges, Pears =regexreplace(JOIN(",",A1:D1),JOIN("|",A2:D2),"")
Issue
The issue comes with overlapping text
A1:1: Fuji Apples, Apples, Grapes, Green Grapes, Pears
B1:1: Apples, Grapes
Desired output: Fuji Apples, Green Grapes, Pears
Actual output: Fuji, Green, Pears

Comments