You can nest multiple SUBSTITUTE()
commands, yes:
SUBSTITUTE(
SUBSTITUTE(
LOWER({Name}),
" ",
"-"
),
"(",
""
)
This, for example, will first perform your substitution of dashes in for spaces, then on the resulting string that comes out of that, will replace any open parenthesis with nothing (ie, will delete them). Unfortunately, you have to just keep nesting each new condition like this, for each new character you need to replace. There is not a way (at least that I have discovered) to use conditional language within a SUBSTITUTE()
statement, such as Replace "(" OR ")" with ""
. It’s all one… at … a … time.
You can nest multiple SUBSTITUTE()
commands, yes:
SUBSTITUTE(
SUBSTITUTE(
LOWER({Name}),
" ",
"-"
),
"(",
""
)
This, for example, will first perform your substitution of dashes in for spaces, then on the resulting string that comes out of that, will replace any open parenthesis with nothing (ie, will delete them). Unfortunately, you have to just keep nesting each new condition like this, for each new character you need to replace. There is not a way (at least that I have discovered) to use conditional language within a SUBSTITUTE()
statement, such as Replace "(" OR ")" with ""
. It’s all one… at … a … time.
awesome thank you for writing out an example!
You can nest multiple SUBSTITUTE()
commands, yes:
SUBSTITUTE(
SUBSTITUTE(
LOWER({Name}),
" ",
"-"
),
"(",
""
)
This, for example, will first perform your substitution of dashes in for spaces, then on the resulting string that comes out of that, will replace any open parenthesis with nothing (ie, will delete them). Unfortunately, you have to just keep nesting each new condition like this, for each new character you need to replace. There is not a way (at least that I have discovered) to use conditional language within a SUBSTITUTE()
statement, such as Replace "(" OR ")" with ""
. It’s all one… at … a … time.
Hi Jeremy,
thank you for the formular. I’m new to this so i’m not sure how to nest 3 substitutes commands in a formular. If you are able to post an example that would help me A LOT!
Kai
Hi Jeremy,
thank you for the formular. I’m new to this so i’m not sure how to nest 3 substitutes commands in a formular. If you are able to post an example that would help me A LOT!
Kai
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
LOWER({Name}),
" ",
"-"
),
"(",
""
),
")",
""
)
There’s three nested substitutes. You just have to make sure that the entire SUBSTITUTE(..., ..., ...)
for a nested formula is in the first parameter space (before the first comma) of the SUBSTITUTE(1st, 2nd, 3rd)
in which it is nested.
These evaluate from the inside out, so keep that in mind while nesting these. If, in an inner SUBSTITUTE()
, you replace all “(” with “-”, and then in an outer SUBSTITUTE()
you replace all “-” with “a”, you will end up replacing all the “-” that you put in through the inner SUBSTITUTE()
.
Hi Jeremy,
thanks for your quick answer. It helped me to get a better understanding how it works!
Have a nice week.
Kai