Hi everyone.
I am trying to kill two birds with one stone in a single formula.
I have three cells that I wish to combine to create an e-mail address cell.
A. E-mail domain
B. First name (F)
C. Last name (L)
However, a fourth cell comes in to play before cells B and C can be concatenated and that cell (D) is the e-mail convention (i.e. F.L, F_L, 1FL etc...) Where '1FL' = 'first letter of First Name followed by Last Name', or 'F1L' = 'First Name followed by first letter of Last Name', or '1F_L' = 'first letter of First Name followed by Last Name, separated by an underscore'.
I have worked out how to concatenate the fields to the point of 'First Name . Last Name @ E-mail domain' ('= B3 & "." & C3 & "@" & A3"). So, one function is sorted - adding the '@' to the e-mail domain.
What I am trying to work out is how to incorporate an IF function that will look at cell D, interrogate the e-mail convention and apply rules before concatenating cells B and C (e.g. - if e-mail convention in cell D is '1F.L', take just the first letter of First Name in cell B, then pull all of Last Name (cell C) into the resulting cell, whilst determining and adding the correct separator ('.' ; '_' ; or no separator).
There are about eighteen (18) possible combinations of e-mail convention;
1F.L
1F_L
1F1L
1FL
1LF
F
F.1L
F.L
F_1L
F_L
F1L
FL
L
L.1F
L.F
L_F
L1F
LF
Which makes the length of the formula mind boggling (for me, anyway)!
Can anyone shed some light on how this can be done, please.
Thanks,
Ed.
Bookmarks