Replace formula for multiple replaces
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi team, I want to know if there is any solution for multiple values using ‘AND’ , ‘OR’.
Example: Replace([Field], ‘ABC’, ‘XYZ’) this formula will replace ABC with XYZ and suppose I use Replace([Field], ‘EDF’, ‘UVW’) and this will replace EDF with UVW I just want to know if there is any way to use single Replace formula to replace ABC with XYZ and EDF with UVW, like we use “OR” , “AND” in “IF” formula
- Labels:
- Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hey @RajatRehria
Believe this should do the trick:
Replace(Replace([Field], ‘ABC’, ‘XYZ’), ‘EDF’, ‘UVW’)
If your replacement values are static, you could also consider using the Find and Replace tool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @RajatRehria
You can use the find replace tool to do this more easily. This tool is perfect to use in situations like this one. Check the attached workflow
Input:
Output:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @RajatRehria you can do this with a simple, single formula using the Switch function:
Switch([Input],[Input],'ABC','XYZ','EDF','UDW')
To illustrate what's happening here, as the function is often a little confusing to understand just from the hover description:
Switch([Input],[Input],'ABC','XYZ','EDF','UDW') - The field the statement will act upon
Switch([Input],[Input],'ABC','XYZ','EDF','UDW') - The default value to put there if no possibilities from the list are found (kind of the equivalent to 'else' in an if statement)
Switch([Input],[Input],'ABC','XYZ','EDF','UDW') - Switch 'ABC' with 'XYZ' i.e. Case1/Result1
Switch([Input],[Input],'ABC','XYZ','EDF','UDW') - Switch 'EDF' with 'UDW' i.e. Case2/Result2
I've only used 2 examples in the list as per your ask above. However, to add more checks/replacements, you just continue to add comma-separated values in the form of 'Target','Replacement' (Case/Result according to the hover description).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
![](/skins/images/72080B1993C0EC7A53569ADF25905C2F/responsive_peak/images/icon_anonymous_message.png)