1

I have a list of emails (roughly 2000) in excel. I need to add a string, "string" to the end of the domain, before the .com.

Before: [email protected]
After: email@yahoo.**string**.com

Before: [email protected]
After: [email protected].**string**.com

I tried to use concatenate but that doesnt seem correct...

Any help would be greatly appreciated!

jobiin
  • 449
  • 2
  • 5
  • 12

3 Answers3

1

If it always ends in .com and you want to insert some text, you can do this (assuming your original strings start in A1) in B1. Let's say your custom string is stored in C1.

=Left(A1,Len(A1)-4)&$C$1&".com"

edit: if not always .com, =SUBSTITUTE(A1,".","." & $C$1 & ".",LEN(A1)-LEN(SUBSTITUTE(A1,".",""))) (thanks @ScottCraner)

enter image description here

BruceWayne
  • 22,923
  • 15
  • 65
  • 110
1

Column A the origin email

Column B will be where you put the formula

Column C the string (Or if its the same string for all of them just replace C1 with it)

=LEFT(A1,LEN(A1-4))&C1&RIGHT(A1,4)

Remember this will only work if the last characters are always 4 (Like .com, .net and not .br, .au)

Moacir
  • 617
  • 4
  • 19
1

Say we have text in A1 with at least one period in the text and zero or more characters after the last period. We know that the position of the last period is given by:

=FIND(CHAR(1),SUBSTITUTE(A1,".",CHAR(1),(LEN(A1)-LEN(SUBSTITUTE(A1,".","")))))

So we put this in B1 and in C1 enter:

=LEFT(A1,B1-1) & "whatever" & MID(A1,B1,9999)

enter image description here

This approach does not depend on the length of the string following that last period.

Community
  • 1
  • 1
Gary's Student
  • 95,722
  • 10
  • 59
  • 99