I have a column where people enter email address manually. I want to validate the email address using this formula:
=AND(FIND(“@”,A2),FIND(“.”,A2),ISERROR(FIND(” “,A2)))
but excel comes up with error that the formula you typed contains an error. For me the formula looks right. Do you guys have any suggestions?
=AND(IFERROR(FIND(".",A2),FALSE),IFERROR(FIND(".",A2,FIND("@",A2)),FALSE))
This will validate the . is after the @ which is not tested on the accepted answer
I bumped into an issue of
firstname.lastname@domain@topdomain
for which I made an amendment that checks the correct order of the@
and the.
with an implicitLike
without VBA.EDIT
"*?@?*.??*"
seems to be even more descriptive as long as top-level domains are at least two characters long (as of this post they are).I got the same error for your code, and it appears that you have NOT "plain" double quotes, that is different from this symbol:
"
.Try my spelling:
=AND(FIND("@",A2),FIND(".",A2),ISERROR(FIND(" ",A2)))
- hope will help!EDIT:
In addition, consider to use
=AND(NOT(ISERROR(FIND("@",A1))),NOT(ISERROR(FIND(".",A1))),ISERROR(FIND(" ",A1)))
- that will prevent errors in case@
or.
are missing. Still, this will pass as OKaaa@.
, but I suppose even such straightforward approach has rights to be used)Another way to validate emails in excel is using VBA code: see code below taken from http://www.vbaexpress.com/kb/getarticle.php?kb_id=281, it works great as is, and you can modify the code based on your needs.
For how to instructions check http://www.vbaexpress.com/kb/getarticle.php?kb_id=281#instr