How To Get The Domain From An Email Address

2017-08-17

Example

=RIGHT(B3,LEN(B3)-FIND(“@”,B3))

Generic Formula

=RIGHT(Email,LEN(Email)-FIND(“@”,Email))

Email – This is the email address from which you’d like to extract the domain from.

What It Does

This formula will return the domain from a given email address. For example the domain of “yourname@yourcompany.com” would be “yourcompany.com”.

How It Works

LEN(Email) will give us the total character count of the email address. In our example LEN(“jim.smith@breadmakers.com”) returns 25 since there are 25 characters in this email address.

FIND(“@”,Email) will return the location of the “@” character in the email address. In our example FIND(“@”,”jim.smith@breadmakers.com”) returns 10 since the “@” symbol is the 10th character in the email address.

The difference between these two will then give us the total character count of all the characters after the “@” symbol. This is the total character count of the domain (let’s call this N). In our example this is 25-10 = 15. We see that “breadmakers.com” does in fact have 15 characters in it.

We can now use RIGHT(Email,DomainCount) to extract the N right most characters from the email address which will be our domain. In our example this is RIGHT(“jim.smith@breadmakers.com”,15) which returns “breadmakers.com”.

About the Author

John MacDougall

John MacDougall

John is a Microsoft MVP and freelance consultant and trainer specializing in Excel, Power BI, Power Automate, Power Apps and SharePoint. You can find other interesting articles from John on his blog or YouTube channel.

Subscribe

Advertisement

Related Articles

Comments

0 Comments

Get The Latest News

Follow Us

Follow us on social media to stay up to date with the latest tips in Excel!

Pin It on Pinterest

Share This