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
16 Replies
Sort By
- Patrick2788Silver ContributorI had an elegant recursive solution for you but realized I was using a few functions not available in Excel 2021. The function gap between 2021 and 365 gets larger by the month it seems.
- Sorro911Copper ContributorHey mate send it through i can use 365 Web for free by the looks of it.
https://www.microsoft.com/en-au/microsoft-365/free-office-online-for-the-web- Sorro911Copper ContributorI can also use google sheets if this helps
- PeterBartholomew1Silver Contributor
= LET( rgx, {"dog|cat|cow|duck|chicken"}, REGEXREPLACE(text, rgx, "fish") )
- Sorro911Copper Contributor
- pvela23Copper Contributor
This is little vague, but you can try this.
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1, "dog", "fish"), "cat", "fish"), "bird", "fish"), "pig", "fish"), "cow", "fish"), "chicken", "fish")
- Sorro911Copper Contributor
Hey mate what am i doing wrong?
- peiyezhuBronze Contributorhttps://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)- Sorro911Copper 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.- peiyezhuBronze 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)
- Sorro911Copper Contributor
- peiyezhuBronze ContributorThe formular regexreplace only available for Office 365 Beta channel.
I guess your Excel should not support it.
Have you tried the webservice?