Google Sheets multiple search and replace from a list

后端 未结 4 1134
温柔的废话
温柔的废话 2021-01-05 03:57

I am looking for a solution to search for certain strings in a Google Sheet and, when found, replace them with another string from a list in another sheet.

For bette

4条回答
  •  渐次进展
    2021-01-05 04:59

    An improvement on JPV's answer, which is orders of magnitude faster and works with arbitrary query and replacement strings:

    =ArrayFormula(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1:A, List!A1, List!B1), List!A2, List!B2), List!A3, List!B3))
    

    Using this format, a 15,000 cell spreadsheet with an 85-length replacement list will update in just a few seconds. Simply assemble the formula string using your scripting language of choice and you're good to go!

提交回复
热议问题