I am trying to find a way to generate email addresses from the first name and the first letter of a last name. I used the CONCATENATE function, but it will only take a full cell, not a first letter.
2 Answers
You may use REGEXTRACT
. See the example below:
Formula:
=REGEXEXTRACT(A1,".")
Here is another example:
Formula:
=CONCATENATE(A1,REGEXEXTRACT(B1,"."),"@email.com")
Other ways to get the first character of a string (assuming here that the last name were in B2):
=CHAR(CODE(B2))
=LEFT(B2)
Another (shorter) way to concatenate (assuming a first name were in A2 and a last name in B2):
=A2&LEFT(B2)
And this is the type of operation that array formulas are meant to address. So, assuming your first names were in A2:A and your last names in B2:B:
1.) Delete ALL of Column C (or any other column that is open for use).
2.) Place the following in cell C1:
=ArrayFormula(IF(A2:A="",,A2:A&LEFT(B2:B)&"@email.com"))