To "tweak" your formula to also check for a comma, you can use an array constant:
EDIT: to correct formula to allow for its use in Data Validation (remove array constant)
=AND(ISNUMBER(FIND("@",A2)),ISNUMBER(FIND(".",A2)),ISERROR(OR(FIND(" ",A2),FIND(",",A2))))
I provide this only as a method of showing one way of testing to exclude multiple characters from a string. This is NOT, in my opinion, a good way to validate an email address.
Note that your formula, if it does NOT find an "@" or a ".", will return a #VALUE!
error. If you would rather it return FALSE
, suggest you wrap those FIND
's in an ISNUMBER
function.
However, and this is my opinion only, I think the best way to ensure that an email address is both valid and correct is to use a system which includes an activation email. That can avoid both typos and malformed data.
Of course, your formula will allow certain types of invalid emails. For example, it does not test that the @
is in the middle of the string, nor the dot. Nor that the dot precedes the @. etc, etc, etc