Dec 28, 2021 01:49 PM
I’m trying to create a SWITCH formula checking for specific text within a field.
For instance, if there is a field with a bunch of random numbers and then a name, I want to check for the name in that field, not match the entirety of the text in the field.
Solved! Go to Solution.
Dec 28, 2021 02:02 PM
Assuming that there’s nothing after the person’s name that needs to be omitted/ignored, this formula that uses a regular expression to extract only the name will work:
IF(
Source,
SWITCH(
REGEX_EXTRACT(Source, "[^\\d]*$"),
"Bob", "Bob's output",
"Jake", "Jake's output",
"Arnold", "Arnold's output"
)
)
If the source material is more complex, could you share a sample?
Dec 28, 2021 02:02 PM
Assuming that there’s nothing after the person’s name that needs to be omitted/ignored, this formula that uses a regular expression to extract only the name will work:
IF(
Source,
SWITCH(
REGEX_EXTRACT(Source, "[^\\d]*$"),
"Bob", "Bob's output",
"Jake", "Jake's output",
"Arnold", "Arnold's output"
)
)
If the source material is more complex, could you share a sample?
Dec 29, 2021 10:39 AM
Worked great. Thank you.