I built this! (Learning faster than I thought possible )
Uses a lookup table:
Items to replace |
Replacement for each item |
1st |
First |
2nd |
Second |
= REGEX(cell,"("&TEXTJOIN("|",1,itemsToReplace)&")", # Find items to replace # VLOOKUP(REGEX(cell,"("&TEXTJOIN("|",1,itemsToReplace)&")"), # Feed found item into lookup # replacementTable,2,0)) # Replace from second column #
Any feedback welcome - I sense there should be a more efficient way of giving the Expression element of the REGEX.
Also - and this is important for my use case, i.e., cleaning punctuation out - I’m getting unhelpful results when I search for (
, )
, or '
← should be serifed apostrophe, not straight.
And so far I haven’t tried a global regex - that might break it, though I think not unless there is more than one item found. So Southend-on-Sea will be ok, but 1st Floor 4-6 High Street will not?