Email generator

You have list of names, like Firstname Lastname. The email addition is comp.com. So the email should be Firstname.Lastname@comp.com.

This is quite simple. In A-column you have names and in C-column the company extensions.

The formula in E1 is =LEFT(A1;(FIND(” “;A1))-1) & “.” & (RIGHT(A1;LEN(A1)-(FIND(” “;A1)))) & “@” & C1 .

First, we take from left digits till space minus one, so the first name is captured. We take four digits from left as the space is the 5th digit. Then dot is added. After that we take digits from right number of digits equal to length of the A1 minus the place of the space. Number of digits in A1 is ten digits. The space is the 5th digit. We take five digits from right. Then we add @ sign and organization information.

The issue is more complex if a family of two persons are in the same line.

If there is Firstname & Firstname1 Lastname and the extension example.com, then the Excel should return Firstname.Lastname@example.com; Firstname1.Lastname@example.com . Then you can copy paste both the emails to Outlook. Sometimes there are two names, sometimes just one.

Like this.

The script in E1 is:

=IF(ISERROR(FIND(“&”;A1));(LEFT(A1;(FIND(” “;A1))-1)&”.”&(RIGHT(A1;LEN(A1)-(FIND(” “;A1))))&”@”&C1);(LEFT(A1;(FIND(” “;A1)-1))&”.”&MID(A1;(FIND(” “;A1;(FIND(” “;A1;FIND(” “;A1)+1))+1))+1;LEN(A1)-(FIND(” “;A1;(FIND(” “;A1;FIND(” “;A1)+1))+1)))&”@”&(C1)&”;”&(MID(A1;(FIND(” “;A1))+2;((FIND(” “;A1;(FIND(” “;A1;FIND(” “;A1)+1))+1))-(FIND(” “;A1))-2)))&”.”&MID(A1;(FIND(” “;A1;(FIND(” “;A1;FIND(” “;A1)+1))+1))+1;LEN(A1)-(FIND(” “;A1;(FIND(” “;A1;FIND(” “;A1)+1))+1)))&”@”&(C1)))

The script got that complex, that I was happy when it was working. So, I did not analyze the script.