Forum Discussion
Sorro911
Aug 27, 2024Copper Contributor
find & replace multiple different words at once
Hi, Does anyone know how I can find & replace multiple different words at once in Excel example: dog, cat, bird, pig, cow, chicken ***replace with a single word*** fish
peiyezhu
Aug 27, 2024Bronze Contributor
https://prod.support.services.microsoft.com/en-us/office/regexreplace-function-9c030bb2-5e47-4efc-bad5-4582d7100897
=regexreplace(A2,"dog|cat|bird|pig|cow|chicken","fish")
or
=WEBSERVICE("https://e.anyoupin.cn/eh3/?regreplace~dog|cat|bird|pig|cow|chicken~fish~" & A2)
=regexreplace(A2,"dog|cat|bird|pig|cow|chicken","fish")
or
=WEBSERVICE("https://e.anyoupin.cn/eh3/?regreplace~dog|cat|bird|pig|cow|chicken~fish~" & A2)
Sorro911
Aug 28, 2024Copper Contributor
This would work best if I can learn how to format it correctly. Also is there a way to make his not case sensitive? e.g. DoG|caT|BIRd|coW|CHICKEn > fish
I really appreciate the help! Thanks in advance.
- peiyezhuAug 29, 2024Bronze Contributor
The syntax of the REGEXEXTRACT function is:
REGEXREPLACE(text, pattern, replacement, [occurrence], [case_sensitivity])
case_sensitivity
Determines whether the match is case-sensitive. By default, the match is case-sensitive. Enter one of the following:
0: Case sensitive
1: Case insensitive
=WEBSERVICE("https://e.anyoupin.cn/eh3/?regreplace~/dog|cat|bird|pig|cow|chicken/i_@//~fish_@~" & A2)- Sorro911Aug 29, 2024Copper ContributorThank you very much for your time and help but non of this has helped.