first and last name to email from one cell

New Contributor


I am trying to create a code to have the first and last name from a single cell to an email address with a dott in between the first and the last name. Example, Anton van der sloot --> anton.vandersloot@...

Another example,

piet de herder --> piet.deherder@......

Does somebody know the code for this?

4 Replies
best response confirmed by Philippevdlof (New Contributor)


=LEFT(C5,SEARCH(" ",C5)-1)&"."&SUBSTITUTE(RIGHT(C5,LEN(C5)-SEARCH(" ",C5))," ","")&""

Maybe with this formula.


Thank you very much! It works.

@Quadruple_Pawn Is there a way to erase #value! message for the cells that aren't filled out? 


=IFERROR(LEFT(C5,SEARCH(" ",C5)-1)&"."&SUBSTITUTE(RIGHT(C5,LEN(C5)-SEARCH(" ",C5))," ","")&"","")

You can wrap the IFERROR around the formula.

email first name and name.JPG