How to Validate Email Domains Against an Approved List in Excel

📅 Jan 07, 2026 📝 Sarah Miller

Managing large contact databases in Excel often leads to administrative headaches when manually verifying if email domains are authorized. While standard funding sources often prioritize enterprise database software for data hygiene, smaller operations must rely on spreadsheet-based verification. Utilizing a dynamic Excel formula grants immediate quality control without high software costs. The only stipulation is maintaining an active table of approved domains to cross-reference, such as comparing a user's domain against your official partner list. Below, we outline the exact formula combination to automate this validation seamlessly.

How to Validate Email Domains Against an Approved List in Excel

Managing and cleaning data is one of the most common challenges Excel users face. When dealing with user sign-ups, lead generation forms, or employee directories, you often need to verify that the email addresses collected belong to an approved list of domains. For instance, you might want to ensure that only corporate partners, specific academic institutions, or authorized client organizations are allowed in your dataset.

In this guide, we will walk you through building a robust Excel formula to extract an email's domain and validate it against an approved list. We will cover traditional methods compatible with older Excel versions, modern functions like TEXTAFTER available in Microsoft 365, and how to implement this validation as a strict data entry rule.

The Core Strategy

To validate an email domain against an approved list, we need to break the problem down into two distinct phases:

  1. Extraction: Isolate the domain portion of the email address (everything after the "@" symbol).
  2. Verification: Compare that extracted domain against a pre-defined list of approved domains and return a TRUE or FALSE (or custom message) indicating its validity.

Step 1: Extracting the Domain from an Email Address

Before we can check if a domain is approved, we must isolate it from the full email address. Depending on your version of Excel, you have two excellent ways to do this.

Method A: The Modern Excel Way (Microsoft 365 & Excel 2021+)

If you are using a modern version of Excel, the simplest way to extract text after a specific character is using the TEXTAFTER function. It is clean, readable, and highly efficient.

=TEXTAFTER(A2, "@")

If cell A2 contains john.doe@company.com, this formula will instantly return company.com.

Method B: The Legacy Excel Way (Excel 2019 and Older)

For backwards compatibility, you can use a combination of MID, FIND, and LEN. This formula locates the position of the "@" symbol and extracts all characters following it:

=MID(A2, FIND("@", A2) + 1, LEN(A2))

How it works:

  • FIND("@", A2) locates the numerical position of the "@" sign.
  • We add + 1 because we want to start extracting characters *after* the "@" sign.
  • LEN(A2) acts as a safe, maximum length parameter to ensure the MID function grabs everything left in the text string.

Step 2: Checking the Domain Against the Approved List

Now that we can isolate the domain, we need to compare it against our master list of approved domains. Let us assume your approved domains are listed in a range named ApprovedDomains (for example, the cell range $E$2:$E$10).

There are a few popular ways to perform this lookup lookup in Excel. We will explore the three most reliable methods.

Approach 1: Using the COUNTIF Function (Simplest & Most Popular)

The COUNTIF function counts how many times a value appears in a range. If the count is greater than 0, it means the domain is on the approved list.

=COUNTIF(ApprovedDomains, Extracted_Domain) > 0

By nesting our legacy extraction formula inside this COUNTIF statement, we get a complete validation formula:

=COUNTIF(ApprovedDomains, MID(A2, FIND("@", A2) + 1, LEN(A2))) > 0

This formula returns TRUE if the domain is approved, and FALSE if it is not.

Approach 2: Using MATCH and ISNUMBER (Most Robust)

The MATCH function searches for a specified item in a range and returns its relative position. If it doesn't find the item, it returns an #N/A error. Wrapping MATCH inside ISNUMBER converts these positions and errors into clean TRUE/FALSE values.

=ISNUMBER(MATCH(MID(A2, FIND("@", A2) + 1, LEN(A2)), ApprovedDomains, 0))

Why use this? The MATCH function with a third argument of 0 enforces an exact match, which is highly reliable for database lookups and large datasets.

Approach 3: Modern XLOOKUP (Excel 365)

For Excel 365 users, XLOOKUP provides an elegant syntax. We can search for the extracted domain and supply a custom fallback value if the domain is not found:

=XLOOKUP(TEXTAFTER(A2, "@"), ApprovedDomains, ApprovedDomains, "Not Approved")

Building a Complete, Bulletproof Solution

In real-world data, things are rarely perfect. Users might leave cells blank, or enter strings that do not contain an "@" symbol at all. If we run our raw extraction formula on these cells, Excel will throw ugly #VALUE! errors.

To make our validation formula production-ready, we should wrap it in an IFERROR function and add a logical check for blank cells. Here is the ultimate, bulletproof formula:

=IF(A2="", "Empty", IFERROR(IF(COUNTIF(ApprovedDomains, MID(A2, FIND("@", A2) + 1, LEN(A2))) > 0, "Approved", "Not Approved"), "Invalid Email"))

Formula Breakdown:

  • IF(A2="", "Empty", ...): First checks if the cell is completely empty to avoid unnecessary calculations.
  • IFERROR(..., "Invalid Email"): If the FIND function fails to locate an "@" symbol, Excel normally returns an error. This wrapper catches that error and outputs "Invalid Email" instead.
  • IF(COUNTIF(...) > 0, "Approved", "Not Approved"): Executes our core validation check and converts the raw TRUE or FALSE into user-friendly labels.

Example Implementation Table

Consider the following setup. We have an approved domain list in column E, and we are validating our input data in column B:

Email Address (Col A) Validation Status (Col B - Formula) Approved Domains (Col E)
alice@microsoft.com Approved microsoft.com
bob@gmail.com Not Approved google.com
charlie@google.com Approved github.com
corrupted_input_text Invalid Email uoregon.edu
(Blank Cell) Empty

Preventing Bad Data Entry Using Data Validation

While identifying unapproved domains in an existing sheet is incredibly useful, it is even better to prevent users from typing them in the first place. Excel's Data Validation feature allows us to embed our formula directly into the cell to restrict input in real-time.

How to set up domain restriction on a range of cells:

  1. Select the cells where users will enter email addresses (e.g., A2:A100).
  2. Go to the Data tab on the Ribbon.
  3. Click on Data Validation in the Data Tools group.
  4. In the Data Validation dialog box, under the Settings tab, click the Allow drop-down and choose Custom.
  5. In the Formula field, enter the following formula (assuming your range starts at cell A2):
    =ISNUMBER(MATCH(MID(A2, FIND("@", A2) + 1, LEN(A2)), ApprovedDomains, 0))
  6. Optional: Go to the Error Alert tab, set the Style to "Stop", enter a Title like "Unauthorized Domain", and type an Error Message (e.g., "Please enter an email address with an approved partner domain.").
  7. Click OK.

Now, if a user attempts to type an email address with an unlisted domain (or an invalid format), Excel will block the input and display your custom error message.


Advanced Scenario: Handling Case Sensitivity and Spaces

By default, Excel's COUNTIF and MATCH functions are case-insensitive. This is generally ideal for email domains, as COMPANY.COM and company.com are functionally identical. However, if you ever need to enforce strict case-sensitivity for your domains, you can swap MATCH with the EXACT function:

=ISNUMBER(MATCH(TRUE, EXACT(MID(A2, FIND("@", A2) + 1, LEN(A2)), ApprovedDomains), 0))

Note: This is an array formula in older Excel versions and may require pressing Ctrl + Shift + Enter.

Additionally, users sometimes accidentally press the spacebar before or after typing an email address. To prevent spaces from breaking your validation formulas, wrap your email reference in the TRIM function, like this:

=TEXTAFTER(TRIM(A2), "@")

Conclusion

Validating email domains in Excel doesn't require complex VBA code or external third-party add-ins. By combining basic text extraction functions (like MID and FIND or the modern TEXTAFTER) with lookup functions (like COUNTIF or MATCH), you can easily automate data cleaning and construct strict, error-free input forms.

Disclaimer:
The documents and templates provided on this page are for informational and illustrative purposes only. They do not constitute professional, legal, or financial advice, and should not be relied upon as such. Because individual circumstances and regulatory requirements vary, these materials may not be suitable for your specific needs. We recommend consulting with a qualified professional before adapting or using any of these examples for official or commercial purposes.