How to Get the Domain from the Email ID in Excel

puneet-gogia-excel-champs

- Written by Puneet

Let’s say you have a list of email IDs, and now you want to extract the domain for each ID. In Excel, a simple formula can extract the domains. And in this tutorial, we learn to write this formula.

get-domain-from-the-email-id
=RIGHT(A2,LEN(A2)-SEARCH("@",A2))

The above formula helps you to get the domain from the email. To understand this formula, you need to split it into three parts.

Get the Position of @ from the Email

First, you need to get the Position of the “@” in the email ID. As you know, in an email ID, the domain start after the “@”. For this, you need to use the SEARCH function.

search-to-get-the-position

In the above example, you have got 6 in the result, meaning the Position of “@” is 6th in the email.

Count the Length of the Domain

Next, get the count of characters from the domain part of the email. And for this, you need to use the LEN function to get the count. And then deduct the Position of the “@” from it.

count-length-of-domain

In the snapshot, we have the domain “yahoo.ca”, which has 8 characters, and that’s what you have got in the result.

Extract Domain

You know the length of the domain in the email ID. So you can use the RIGHT function to get the domain from the right side of the cell.

extract-domain

RIGHT uses the count of domain characters and gets it from the email ID’s end.

Get the Excel File

Last Updated: December 02, 2023