0

I have a column of E-mail addresses in a Google Sheet and want to remove all of the domain names and '@' symbol and copy this to a new column. For example:

  • Column-A
  • test@test.com
  • testb@gmail.com
  • testc@yahoo.com

Copied and removing the domains to:

  • Column-B
  • test
  • testb
  • testc
player0
  • 124,011
  • 12
  • 67
  • 124
Jeeves
  • 424
  • 1
  • 7
  • 25

3 Answers3

1

all you need is:

=ARRAYFORMULA(IFNA(REGEXEXTRACT(A1:A&"", "(.+)@")))

enter image description here

player0
  • 124,011
  • 12
  • 67
  • 124
0

My answer as per my understanding maybe I'm wrong so please follow if I'm right to understand. use split to get this

enter image description here

Go to Data Click on Split Text to Columns Pick Custom From Drop Down enter @ and you get your result.

enter image description here

kelalaka
  • 5,064
  • 5
  • 27
  • 44
hardy
  • 537
  • 1
  • 5
  • 19
0

use this function on google App script:

function myFunction() {
// Your spreadsheet
var ss = SpreadsheetApp.getActive()
//if you got only one sheet
var sheet = ss.getSheets()[0];
// This is in the case that your sheet as a header, if not replace 2 by 1 and (sheet.getLastRow()-1) by sheet.getLastRow()
var valuesColumnA = sheet.getRange(2,1,(sheet.getLastRow()-1)).getValues();
//Just to have each value in the same array
var valuesColumnAMapped = valuesColumnA.map(function(r){return r[0]});

valuesColumnAMapped.forEach(function(value, index){
var split = value.split("@");
sheet.getRange((index+2),2).setValue(split[0]);
})
}
Kevkeev13
  • 379
  • 1
  • 9