Google-sheets – Copy entire rows from one sheet to another if certain cell in first sheet does NOT contain certain text value

formulasgoogle sheetsgoogle-sheets-query

I have two sheets.
The first one has incoming data that dynamically updates. The fields are Name, Last Name, Email.
I want to duplicate the rows in a second sheet but only if the email field in sheet 1 does NOT end with or contain "@gmail.com".

Any idea on how can I accomplish this?

Best Answer

With importrange + regexmatch

Don't forget to allow access to connect the two sheets.

=filter(
IMPORTRANGE(SHEET URL,"Sheet2!A1:A3"),
not(arrayformula(regexmatch(IMPORTRANGE(SHEET URL,"Sheet2!A1:A3"),"@gmail\.com")))
)