Which Google Spreadsheets formula do I use to get the domain part from an email address?Example: bob@example.com → example.com
Which formula extracts the domain name from an email address (bob@example.com -> example.com)?
google spreadsheets;formulas;regex
I would use the following formula to obtain an URL.Formula=IF(ISEMAIL(A2),   REGEXEXTRACT(A2,@(.+)),   IF(ISURL(A2),     A2,     IF(ISURL(REGEXEXTRACT(A2,@(.+))),       REGEXEXTRACT(A2,@(.+)),       No valid entry     )   ) ) Copy / Paste  =IF(ISEMAIL(A2),REGEXEXTRACT(A2,@(.+)),IF(ISURL(A2),A2,IF(ISURL(REGEXEXTRACT(A2,@(.+))),REGEXEXTRACT(A2,@(.+)),No valid entry)))ExplainedA1 is validated for being an e-mail address. If TRUE, then use the REGEXEXTRACT formula you constructed. If the e-mail address turns out to be not a valid address, then validate for an URL. If the URL turns out to be not a valid URL, then check if the REGEX is an valid URL. Show text No valid entry is no of the IF statements are true.ScreenshotExampleI've created an example file for you: Get domain from email address 