top of page

You are learning Data Validation in MS Excel

How to validate email addresses using data validation in Excel?

Here's how to validate email addresses using data validation in Excel:

1. Select the cells: Choose the column or range of cells where you want to validate email addresses.

2. Data Validation: Go to the "Data" tab on the Excel ribbon. In the "Data Tools" group, click "Data Validation."

3. Set Allow to Custom: In the "Settings" tab of the Data Validation window, under "Allow," choose "Custom" from the dropdown menu.

4. Enter the Formula: Here's the formula you'll use in the "Formula" box:

`=AND(ISNUMBER(SEARCH("@",A1)), ISNUMBER(SEARCH(".",A1)), NOT(ISNUMBER(SEARCH(" ",A1))))`

Explanation of the Formula:

- `A1`: Replace this with the cell reference of your first email address. Adjust the cell reference based on your selected range (e.g., B2:B10).
- `ISNUMBER(SEARCH("@",A1))`: Checks if "@" symbol exists in the email address.
- `ISNUMBER(SEARCH(".",A1))`: Checks if a period (".") exists in the email address.
- `NOT(ISNUMBER(SEARCH(" ",A1)))`: Ensures there are no spaces in the email address (valid addresses don't typically allow spaces).

5. Error Message (Optional): In the "Input Message" box, you can type a message that will appear when users hover over the cell. This message can explain the expected email format.

6. Error Alert (Optional): In the "Show error message when invalid data is entered" box, you can create a custom error message that will pop up if an invalid email is entered.

7. Click OK: Click "OK" to close the Data Validation window.

With this setup, any email address entered in the specified cells will be checked against the formula. If the email doesn't meet the criteria (e.g., missing "@", no period, or containing spaces), Excel will prevent the entry or display an error message based on your settings.

bottom of page