Help

If an email address column contains [string], put "ABC"

Topic Labels: Formulas
Solved
Jump to Solution
1518 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Maria_Ada_Santo
4 - Data Explorer
4 - Data Explorer

Hello everyone! I have an email address column. I want to create a formula column that will search each email domain for a specific text string; if that specific string exists, the formula column will print a pre-determined ID (also as a text/string). To illustrate:

If an email address comes from abcd@paypal.com, input “PAYPAL” into the formula column. If an email address comes from zyxw@vrbo.com, input “VRBO.” I’ve tried combinations of Nested IF statements, SEARCH and FIND formulas, etc. but I’m stuck and would appreciate help. Here’s a screenshot showing the end result I’m looking for.

Screen Shot 2022-01-14 at 4.12.20 PM

1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto
IF(
    FIND("@apple.com", {Email}),
    "APPL",
IF(
    FIND("@beaniebabies.com", {Email}),
    "BNBB",
IF(
    FIND("@century21.com", {Email}),
    "CENT",
IF(
    FIND("@dairyqueen.com", {Email}),
    "DRQN"
))))

See Solution in Thread

2 Replies 2
kuovonne
18 - Pluto
18 - Pluto
IF(
    FIND("@apple.com", {Email}),
    "APPL",
IF(
    FIND("@beaniebabies.com", {Email}),
    "BNBB",
IF(
    FIND("@century21.com", {Email}),
    "CENT",
IF(
    FIND("@dairyqueen.com", {Email}),
    "DRQN"
))))

This could also be done using REGEX_EXTRACT() to pick out the email domain, and SWITCH() based on that to set the ID:

IF(
    Email,
    SWITCH(
        REGEX_EXTRACT(Email, "@.*"),
        "@apple.com", "APPL",
        "@beaniebabies.com", "BNBB",
        "@century21.com", "CENT",
        "@dairyqueen.com", "DRQN"
    )
)

Screen Shot 2022-01-14 at 8.29.12 PM