![Maria_Ada_Santo Maria_Ada_Santo](https://community.airtable.com/legacyfs/online/avatars/3X/7/c/7cf878b53d662ce3ab79db941c631109f3246b48.png)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 14, 2022 01:15 PM
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.
Solved! Go to Solution.
Accepted Solutions
![kuovonne kuovonne](https://community.airtable.com/legacyfs/online/avatars/3X/b/c/bcecb2d58f8302e9d9f520621c02ff41be54488c.jpeg)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 14, 2022 01:29 PM
IF(
FIND("@apple.com", {Email}),
"APPL",
IF(
FIND("@beaniebabies.com", {Email}),
"BNBB",
IF(
FIND("@century21.com", {Email}),
"CENT",
IF(
FIND("@dairyqueen.com", {Email}),
"DRQN"
))))
![kuovonne kuovonne](https://community.airtable.com/legacyfs/online/avatars/3X/b/c/bcecb2d58f8302e9d9f520621c02ff41be54488c.jpeg)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 14, 2022 01:29 PM
IF(
FIND("@apple.com", {Email}),
"APPL",
IF(
FIND("@beaniebabies.com", {Email}),
"BNBB",
IF(
FIND("@century21.com", {Email}),
"CENT",
IF(
FIND("@dairyqueen.com", {Email}),
"DRQN"
))))
![Justin_Barrett Justin_Barrett](https://community.airtable.com/legacyfs/online/avatars/3X/3/2/322b62e252e04faf5485b361bfe1e5a346583374.png)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 14, 2022 08:28 PM
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"
)
)
![](/skins/images/75AB00B4920FD2D67A8CABF77C9DECC4/responsive_peak/images/icon_anonymous_message.png)